[mutter/wayland] display: Fix logic for determining whether our focus was successful



commit eec0f5df4752d95b0ff5788e782fc5a7a4708b42
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Nov 25 15:13:48 2013 -0500

    display: Fix logic for determining whether our focus was successful
    
    In some cases, we can focus the frame window instead of the client
    window, so make sure that our checks include that as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=715030

 src/core/display.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 2989648..49aea52 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1942,6 +1942,19 @@ handle_window_focus_event (MetaDisplay  *display,
 }
 
 static gboolean
+window_has_xwindow (MetaWindow *window,
+                    Window      xwindow)
+{
+  if (window->xwindow == xwindow)
+    return TRUE;
+
+  if (window->frame && window->frame->xwindow == xwindow)
+    return TRUE;
+
+  return FALSE;
+}
+
+static gboolean
 meta_display_handle_event (MetaDisplay        *display,
                            const ClutterEvent *event)
 {
@@ -2929,7 +2942,7 @@ meta_display_handle_xevent (MetaDisplay *display,
 
   if (event->xany.serial > display->focus_serial &&
       display->focus_window &&
-      display->focus_window->xwindow != display->server_focus_window)
+      !window_has_xwindow (display->focus_window, display->server_focus_window))
     {
       meta_topic (META_DEBUG_FOCUS, "Earlier attempt to focus %s failed\n",
                   display->focus_window->desc);


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