From 1e990ad823821ada0cab867c843870bf67825e1e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 29 Sep 2022 14:12:42 +0200 Subject: [PATCH] core: Change meta_display_get_grab_op() to has_grab() Make this public API check just return a boolean about whether there is an existing grab, instead of exposing MetaGrabOp. It is desirable to avoid exposing details like META_GRAB_OP_WAYLAND_POPUP, so that MetaDisplay and wayland grabs can port to ClutterGrab at their own pace, but also this further information is unused. This is likely to be temporary API anyways, after both MetaDisplay and wayland grabs port to Clutter, it will be possible to check the ClutterStage for all of them. Part-of: --- src/core/display.c | 13 ++++++------- src/meta/display.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 526674c3b..9a7d9a12e 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2065,18 +2065,17 @@ meta_display_end_grab_op (MetaDisplay *display, } /** - * meta_display_get_grab_op: + * meta_display_is_grabbed: * @display: The #MetaDisplay that the window is on - * Gets the current grab operation, if any. + * Returns %TRUE if there is an ongoing grab operation. * - * Return value: the current grab operation, or %META_GRAB_OP_NONE if - * Mutter doesn't currently have a grab. + * Return value: Whether there is an active display grab operation. */ -MetaGrabOp -meta_display_get_grab_op (MetaDisplay *display) +gboolean +meta_display_is_grabbed (MetaDisplay *display) { - return display->grab_op; + return display->grab_op != META_GRAB_OP_NONE; } void diff --git a/src/meta/display.h b/src/meta/display.h index 206e08c0c..f53346c24 100644 --- a/src/meta/display.h +++ b/src/meta/display.h @@ -148,7 +148,7 @@ void meta_display_end_grab_op (MetaDisplay *display, guint32 timestamp); META_EXPORT -MetaGrabOp meta_display_get_grab_op (MetaDisplay *display); +gboolean meta_display_is_grabbed (MetaDisplay *display); META_EXPORT guint meta_display_add_keybinding (MetaDisplay *display,