Skip to content

Commit 1451edd

Browse files
committed
fix(stack): Decouple fullscreen stacking layer from focus
Fullscreen clients are assigned a special stacking layer via client_layer_translator(). Previously, this was conditioned on the client having focus. When switching focus away from a fullscreen client (e.g. via awful.client.focus.byidx), the fullscreen client could intermittently remain visually on top despite losing focus, because the layer reassignment depended on a restack that was not always triggered by the focus change. This is fixed by conditioning the fullscreen layer on the client being at the top of the internal stack (i.e. the most recently raised client) rather than on focus. Since keyboard focus changes go through raise(), the fullscreen layer is correctly updated when switching away. Sloppy mouse-enter focus (which does not call raise) is unaffected, as it does not alter the internal stack order. Signed-off-by: Alexander Melnyk <inboxnumberzero@zoho.com>
1 parent a89abd5 commit 1451edd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stack.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ client_layer_translator(client_t *c)
132132
/* first deal with user set attributes */
133133
if(c->ontop)
134134
return WINDOW_LAYER_ONTOP;
135-
/* Fullscreen windows only get their own layer when they have the focus */
136-
else if(c->fullscreen && globalconf.focus.client == c)
135+
/* Fullscreen windows only get their own layer when they are the most
136+
* recently raised client. Using the stack position (instead of focus)
137+
* ensures that focus changes alone (e.g. sloppy / mouse-enter focus)
138+
* do not alter the stacking order of fullscreen windows. */
139+
else if(c->fullscreen && globalconf.stack.len
140+
&& globalconf.stack.tab[globalconf.stack.len-1] == c)
137141
return WINDOW_LAYER_FULLSCREEN;
138142
else if(c->above)
139143
return WINDOW_LAYER_ABOVE;

0 commit comments

Comments
 (0)