x11-display: Get next serial just before using it

We ask XLib the next request serial number before performing other actions
triggered by meta_x11_display_set_input_focus_internal() that doesn't use
the request serial anyways. So, just request it before updating the focus
window as that's the operation that needs it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/909
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-04 12:36:36 +01:00 committed by Marco Trevisan
parent efe5bed5b4
commit ffa0a24848

View File

@ -1937,8 +1937,8 @@ meta_x11_display_set_input_focus_xwindow (MetaX11Display *x11_display,
if (meta_display_timestamp_too_old (x11_display->display, &timestamp))
return;
serial = XNextRequest (x11_display->xdisplay);
meta_x11_display_set_input_focus_internal (x11_display, window, timestamp);
serial = XNextRequest (x11_display->xdisplay);
meta_x11_display_update_focus_window (x11_display, window, serial, TRUE);
meta_display_update_focus_window (x11_display->display, NULL);
meta_display_remove_autoraise_callback (x11_display->display);