[mutter] x11-display: Get next serial just before using it



commit ffa0a2484815540f34ffb696ccac193734912902
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Mon Nov 4 12:36:36 2019 +0100

    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, &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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]