[mutter] cursor-renderer: Popups need to set cursors, too



commit 471e6b9e1324e2a83e40e969d8bb9f654981fee3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Aug 15 13:30:31 2014 -0400

    cursor-renderer: Popups need to set cursors, too
    
    Popups could not set the cursor image, because the cursor tracker would
    ignore window cursors if we had a popup active. The correct condition to
    check for is already in should_block_wayland. Rename this to the more
    sensible name windows_are_interactable, and use it in the cursor tracker.

 src/backends/meta-cursor-tracker.c |    2 +-
 src/core/display-private.h         |    2 +-
 src/core/display.c                 |   14 ++++++--------
 3 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c
index 905b5d1..1399145 100644
--- a/src/backends/meta-cursor-tracker.c
+++ b/src/backends/meta-cursor-tracker.c
@@ -61,7 +61,7 @@ get_displayed_cursor (MetaCursorTracker *tracker)
   if (!tracker->is_showing)
     return NULL;
 
-  if (display->grab_op == META_GRAB_OP_NONE)
+  if (meta_grab_op_windows_are_interactable (display->grab_op))
     {
       if (tracker->has_window_cursor)
         return tracker->window_cursor;
diff --git a/src/core/display-private.h b/src/core/display-private.h
index a432532..da2bec2 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -380,7 +380,7 @@ gboolean meta_grab_op_is_resizing (MetaGrabOp op);
 gboolean meta_grab_op_is_moving_or_resizing (MetaGrabOp op);
 gboolean meta_grab_op_is_mouse    (MetaGrabOp op);
 gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
-gboolean meta_grab_op_should_block_wayland (MetaGrabOp op);
+gboolean meta_grab_op_windows_are_interactable (MetaGrabOp op);
 
 void meta_display_increment_focus_sentinel (MetaDisplay *display);
 void meta_display_decrement_focus_sentinel (MetaDisplay *display);
diff --git a/src/core/display.c b/src/core/display.c
index 527cb1e..4a5062c 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1261,23 +1261,21 @@ meta_grab_op_is_moving_or_resizing (MetaGrabOp op)
 }
 
 /**
- * meta_grab_op_should_block_wayland:
+ * meta_grab_op_windows_are_interactable:
  * @op: A #MetaGrabOp
  *
- * Starting a grab with one of these grab operations means
- * that we will remove key / pointer focus from the current
- * Wayland focus.
+ * Whether windows can be interacted with in this grab operation.
  */
 gboolean
-meta_grab_op_should_block_wayland (MetaGrabOp op)
+meta_grab_op_windows_are_interactable (MetaGrabOp op)
 {
   switch (op)
     {
     case META_GRAB_OP_WAYLAND_POPUP:
     case META_GRAB_OP_NONE:
-      return FALSE;
-    default:
       return TRUE;
+    default:
+      return FALSE;
     }
 }
 
@@ -1446,7 +1444,7 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
   MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
   MetaWindow *focus_window = NULL;
 
-  if (meta_grab_op_should_block_wayland (display->grab_op))
+  if (!meta_grab_op_windows_are_interactable (display->grab_op))
     focus_window = NULL;
   else if (meta_display_xwindow_is_a_no_focus_window (display, display->focus_xwindow))
     focus_window = NULL;


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