Skip to content

Commit 82cde1a

Browse files
committed
Give input focus to globally active clients
This technically violates the ICCCM, but the alternative is not much better: these windows *will* have focus in the GUI qube, so not giving them focus on the agent side will cause the X state to no longer be the same on both sides. Worse, such clients might not be expecting to lose focus without warning. Explicitly taking focus away from them might help. This is based on a similar commit in wlroots.
1 parent a3313a4 commit 82cde1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gui-agent/vmside.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ static void handle_focus(Ghandles * g, XID winid)
18121812
}
18131813

18141814
// Give input focus only to window that set the input hint
1815-
if (input_hint)
1815+
if (input_hint || take_focus)
18161816
XSetInputFocus(g->display, winid, RevertToParent, g->time);
18171817

18181818
// Do not send take focus if the window doesn't support it
@@ -1830,7 +1830,7 @@ static void handle_focus(Ghandles * g, XID winid)
18301830
fprintf(stderr, "WARNING handle_focus: Window 0x%x data not initialized", (int)winid);
18311831
input_hint = True;
18321832
}
1833-
if (input_hint)
1833+
if (input_hint || take_focus)
18341834
XSetInputFocus(g->display, None, RevertToParent, g->time);
18351835

18361836
if (g->log_level > 1)

0 commit comments

Comments
 (0)