Commit 8fd55fef authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Jonas Ådahl

x11: Update focus on the X11 display before the MetaDisplay

The meta_display_update_focus_window() call has indirect dependencies
on the X11 focus window, in order to determine the correct focus window
on the Wayland side (i.e. may turn out NULL with certain X windows).

In order to have the right x11_display->focus_xwindow there, we should
perform first the focus update on the X11 display.

Fixes focusing of Java applications, as those don't seem to go through
_NET_ACTIVE_WINDOW.

Closes: #819
parent acfd03da
Pipeline #118673 passed with stages
in 5 minutes and 32 seconds
......@@ -808,12 +808,12 @@ handle_window_focus_event (MetaX11Display *x11_display,
(!x11_display->focused_by_us &&
x11_display->server_focus_serial == x11_display->focus_serial))
{
meta_display_update_focus_window (display, focus_window);
meta_x11_display_update_focus_window (x11_display,
focus_window ?
focus_window->xwindow : None,
x11_display->server_focus_serial,
FALSE);
meta_display_update_focus_window (display, focus_window);
return TRUE;
}
else
......@@ -1807,13 +1807,13 @@ meta_x11_display_handle_xevent (MetaX11Display *x11_display,
{
meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed\n",
display->focus_window->desc);
meta_display_update_focus_window (display,
meta_x11_display_lookup_x_window (x11_display,
x11_display->server_focus_window));
meta_x11_display_update_focus_window (x11_display,
x11_display->server_focus_window,
x11_display->server_focus_serial,
FALSE);
meta_display_update_focus_window (display,
meta_x11_display_lookup_x_window (x11_display,
x11_display->server_focus_window));
}
if (event->xany.window == x11_display->xroot)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment