display: Fix a possible bug in meta_display_sync_wayland_focus

The check for the focus xwindow is called, but not used. Fix that by
renaming the variable to reflect better what it does and actually using
the return value of the check.

This was the original intention of the author in commit
05899596d10918df5359d89baa82e6fedd0ae208 and got broken in commit
8e7e1eeef59c4f74046e6783b6334c1432255c5a.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/535
This commit is contained in:
Jonas Dreßler 2019-04-14 17:15:06 +02:00 committed by Georges Basile Stavracas Neto
parent 1ca0fdc928
commit 0d50a37091

View File

@ -1214,15 +1214,15 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
MetaWindow *focus_window = NULL;
MetaBackend *backend = meta_get_backend ();
MetaStage *stage = META_STAGE (meta_backend_get_stage (backend));
gboolean is_focus_xwindow = FALSE;
gboolean is_no_focus_xwindow = FALSE;
if (display->x11_display)
meta_x11_display_xwindow_is_a_no_focus_window (display->x11_display,
display->x11_display->focus_xwindow);
is_no_focus_xwindow = meta_x11_display_xwindow_is_a_no_focus_window (display->x11_display,
display->x11_display->focus_xwindow);
if (!meta_display_windows_are_interactable (display))
focus_window = NULL;
else if (is_focus_xwindow)
else if (is_no_focus_xwindow)
focus_window = NULL;
else if (display->focus_window && display->focus_window->surface)
focus_window = display->focus_window;