mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
x11/events: Do not update focus XWindow during grabs
During grabs, it is expected that the X11 focus does not correspond to the display's focus window, as focus should be on the stage's XWindow instead. This still messes up the keyboard focus even after we stopped moving the X11 focus, because we end up with a presumed X11 focus window of None, and as a result the stage is considered unfocused. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5932 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2776>
This commit is contained in:
parent
7531669b4f
commit
0e6395d932
@ -1007,6 +1007,9 @@ handle_input_xevent (MetaX11Display *x11_display,
|
|||||||
break;
|
break;
|
||||||
case XI_FocusIn:
|
case XI_FocusIn:
|
||||||
case XI_FocusOut:
|
case XI_FocusOut:
|
||||||
|
if (clutter_stage_get_grab_actor (stage) != NULL)
|
||||||
|
break;
|
||||||
|
|
||||||
if (handle_window_focus_event (x11_display, window, enter_event, serial) &&
|
if (handle_window_focus_event (x11_display, window, enter_event, serial) &&
|
||||||
enter_event->event == enter_event->root)
|
enter_event->event == enter_event->root)
|
||||||
{
|
{
|
||||||
@ -1942,7 +1945,8 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
|
|||||||
if (x11_display->focused_by_us &&
|
if (x11_display->focused_by_us &&
|
||||||
event->xany.serial > x11_display->focus_serial &&
|
event->xany.serial > x11_display->focus_serial &&
|
||||||
display->focus_window &&
|
display->focus_window &&
|
||||||
!window_has_xwindow (display->focus_window, x11_display->server_focus_window))
|
!window_has_xwindow (display->focus_window, x11_display->server_focus_window) &&
|
||||||
|
meta_display_windows_are_interactable (display))
|
||||||
{
|
{
|
||||||
meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed",
|
meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed",
|
||||||
display->focus_window->desc);
|
display->focus_window->desc);
|
||||||
|
Loading…
Reference in New Issue
Block a user