Check if c is fullscreen before reparenting it to LyrFloating

Closes: https://github.com/djpohly/dwl/issues/487
This commit is contained in:
Forrest Bushstone 2023-09-29 18:16:42 -04:00 committed by Leonardo Hernández Hernández
parent aec21eca1f
commit f695674361
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

7
dwl.c
View File

@ -2028,7 +2028,8 @@ setfloating(Client *c, int floating)
c->isfloating = floating; c->isfloating = floating;
if (!c->mon) if (!c->mon)
return; return;
wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]); wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
arrange(c->mon); arrange(c->mon);
printstatus(); printstatus();
} }
@ -2041,7 +2042,7 @@ setfullscreen(Client *c, int fullscreen)
return; return;
c->bw = fullscreen ? 0 : borderpx; c->bw = fullscreen ? 0 : borderpx;
client_set_fullscreen(c, fullscreen); client_set_fullscreen(c, fullscreen);
wlr_scene_node_reparent(&c->scene->node, layers[fullscreen wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen
? LyrFS : c->isfloating ? LyrFloat : LyrTile]); ? LyrFS : c->isfloating ? LyrFloat : LyrTile]);
if (fullscreen) { if (fullscreen) {
@ -2102,8 +2103,8 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
/* Make sure window actually overlaps with the monitor */ /* Make sure window actually overlaps with the monitor */
resize(c, c->geom, 0); resize(c, c->geom, 0);
c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */ c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
setfloating(c, c->isfloating);
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */ setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
setfloating(c, c->isfloating);
} }
focusclient(focustop(selmon), 1); focusclient(focustop(selmon), 1);
} }