[mutter] pointer: Split out the code that gets the proper focus surface as well



commit 020f209c458e42840912e618792118c0ee29fc17
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 18 18:54:35 2014 -0400

    pointer: Split out the code that gets the proper focus surface as well

 src/wayland/meta-wayland-pointer.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 0b84a09..e9f0c24 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -352,16 +352,21 @@ count_buttons (const ClutterEvent *event)
   return count;
 }
 
-static void
-sync_focus_surface (MetaWaylandPointer *pointer)
+static MetaWaylandSurface *
+get_focus_surface (MetaWaylandPointer *pointer)
 {
-  MetaWaylandSurface *focus_surface;
   MetaDisplay *display = meta_get_display ();
 
   if (meta_grab_op_should_block_wayland (display->grab_op))
-    focus_surface = NULL;
-  else
-    focus_surface = pointer->current;
+    return NULL;
+
+  return pointer->current;
+}
+
+static void
+sync_focus_surface (MetaWaylandPointer *pointer)
+{
+  MetaWaylandSurface *focus_surface = get_focus_surface (pointer);
 
   if (focus_surface != pointer->focus_surface)
     {


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