Skip to content

Commit

Permalink
Give input focus to globally active clients
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DemiMarie committed Aug 9, 2022
1 parent a3313a4 commit 82cde1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gui-agent/vmside.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ static void handle_focus(Ghandles * g, XID winid)
}

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

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

if (g->log_level > 1)
Expand Down

0 comments on commit 82cde1a

Please sign in to comment.