From ffa0a2484815540f34ffb696ccac193734912902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 4 Nov 2019 12:36:36 +0100 Subject: [PATCH] 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 --- src/x11/meta-x11-display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index 03cbce3ec..7b4a686c5 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -1937,8 +1937,8 @@ meta_x11_display_set_input_focus_xwindow (MetaX11Display *x11_display, if (meta_display_timestamp_too_old (x11_display->display, ×tamp)) 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);