[mutter/wip/carlosg/xwayland-on-demand: 29/32] sm focus shuffling



commit a89628b11e5116e130cd156c842784ad872aacc5
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Dec 30 23:27:18 2018 +0100

    sm focus shuffling

 src/x11/meta-x11-display.c | 37 ++++++-------------------------------
 1 file changed, 6 insertions(+), 31 deletions(-)
---
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index f582bfa43..e035a8138 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -1887,42 +1887,17 @@ meta_x11_display_set_input_focus (MetaX11Display *x11_display,
   meta_x11_error_trap_pop (x11_display);
 }
 
-static void
-request_xserver_input_focus_change (MetaX11Display *x11_display,
-                                    MetaWindow     *meta_window,
-                                    Window          xwindow,
-                                    guint32         timestamp)
-{
-  gulong serial;
-
-  if (meta_display_timestamp_too_old (x11_display->display, &timestamp))
-    return;
-
-  meta_x11_error_trap_push (x11_display);
-
-  serial = XNextRequest (x11_display->xdisplay);
-
-  meta_x11_display_set_input_focus (x11_display, xwindow, timestamp);
-  meta_display_update_focus_window (x11_display->display, meta_window);
-  meta_x11_display_update_focus_window (x11_display, xwindow, serial, TRUE);
-
-  meta_x11_error_trap_pop (x11_display);
-
-  x11_display->display->last_focus_time = timestamp;
-
-  if (meta_window == NULL || meta_window != x11_display->display->autoraise_window)
-    meta_display_remove_autoraise_callback (x11_display->display);
-}
-
 void
 meta_x11_display_set_input_focus_xwindow (MetaX11Display *x11_display,
                                           Window          window,
                                           guint32         timestamp)
 {
-  request_xserver_input_focus_change (x11_display,
-                                      NULL,
-                                      window,
-                                      timestamp);
+  gulong serial;
+
+  meta_display_unset_input_focus (x11_display->display, timestamp);
+  serial = XNextRequest (x11_display->xdisplay);
+  meta_x11_display_set_input_focus (x11_display, window, timestamp);
+  meta_x11_display_update_focus_window (x11_display, window, serial, TRUE);
 }
 
 static MetaX11DisplayLogicalMonitorData *


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