[mutter] display: Rename grab_op_is_wayland to grab_op_should_block_wayland



commit 30d534f17ed0bf0212d8a59e0bcb54cbcca60ede
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sat Apr 12 00:13:57 2014 -0700

    display: Rename grab_op_is_wayland to grab_op_should_block_wayland
    
    The idea here is that while we take a WM-side grab, like a compositor
    grab or a resizing grab, we need to remove the focus from the Wayland
    client.
    
    We make a special exception for CLICKING operations, because these
    are really an internal state machine while you're pressing on a button
    inside a frame, and in this case, we need to not kill the focus.

 src/core/display-private.h      |    2 +-
 src/core/display.c              |   12 ++++++++++--
 src/wayland/meta-wayland-seat.c |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/core/display-private.h b/src/core/display-private.h
index 8209c8f..9f18031 100644
--- a/src/core/display-private.h
+++ b/src/core/display-private.h
@@ -441,8 +441,8 @@ gboolean meta_grab_op_is_moving   (MetaGrabOp op);
 gboolean meta_grab_op_is_resizing (MetaGrabOp op);
 gboolean meta_grab_op_is_mouse    (MetaGrabOp op);
 gboolean meta_grab_op_is_clicking (MetaGrabOp op);
-gboolean meta_grab_op_is_wayland  (MetaGrabOp op);
 gboolean meta_grab_op_is_keyboard (MetaGrabOp op);
+gboolean meta_grab_op_should_block_wayland (MetaGrabOp op);
 
 void meta_display_devirtualize_modifiers (MetaDisplay        *display,
                                           MetaVirtualModifier modifiers,
diff --git a/src/core/display.c b/src/core/display.c
index 86a2375..9a382ab 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1290,8 +1290,16 @@ meta_grab_op_is_clicking (MetaGrabOp grab_op)
     }
 }
 
+/**
+ * meta_grab_op_should_block_wayland:
+ * @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.
+ */
 gboolean
-meta_grab_op_is_wayland (MetaGrabOp op)
+meta_grab_op_should_block_wayland (MetaGrabOp op)
 {
   return (op != META_GRAB_OP_NONE && !meta_grab_op_is_clicking (op));
 }
@@ -1514,7 +1522,7 @@ meta_display_sync_wayland_input_focus (MetaDisplay *display)
   MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
   MetaWindow *focus_window = NULL;
 
-  if (meta_grab_op_is_wayland (display->grab_op))
+  if (meta_grab_op_should_block_wayland (display->grab_op))
     focus_window = NULL;
   else if (meta_display_xwindow_is_a_no_focus_window (display, display->focus_xwindow))
     focus_window = NULL;
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index f5e3867..24280d3 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -461,7 +461,7 @@ meta_wayland_seat_repick (MetaWaylandSeat    *seat,
   MetaWaylandSurface *surface = NULL;
   MetaDisplay        *display = meta_get_display ();
 
-  if (meta_grab_op_is_wayland (display->grab_op))
+  if (meta_grab_op_should_block_wayland (display->grab_op))
     {
       meta_wayland_pointer_update_current_focus (pointer, NULL);
       return;


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