mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
wayland: Add meta_wayland_compositor_is_grabbed() method
This will return TRUE if there is an existing pointer or keyboard grab from the wayland compositor. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2683>
This commit is contained in:
parent
1e990ad823
commit
aed3979064
@ -926,3 +926,9 @@ meta_wayland_keyboard_class_init (MetaWaylandKeyboardClass *klass)
|
||||
|
||||
object_class->finalize = meta_wayland_keyboard_finalize;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_keyboard_is_grabbed (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
return keyboard->grab != &keyboard->default_grab;
|
||||
}
|
||||
|
@ -142,4 +142,6 @@ void meta_wayland_keyboard_start_grab (MetaWaylandKeyboard *keyboard,
|
||||
MetaWaylandKeyboardGrab *grab);
|
||||
void meta_wayland_keyboard_end_grab (MetaWaylandKeyboard *keyboard);
|
||||
|
||||
gboolean meta_wayland_keyboard_is_grabbed (MetaWaylandKeyboard *keyboard);
|
||||
|
||||
#endif /* META_WAYLAND_KEYBOARD_H */
|
||||
|
@ -1571,3 +1571,9 @@ meta_wayland_pointer_class_init (MetaWaylandPointerClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_pointer_is_grabbed (MetaWaylandPointer *pointer)
|
||||
{
|
||||
return pointer->grab != &pointer->default_grab;
|
||||
}
|
||||
|
@ -159,4 +159,6 @@ void meta_wayland_surface_cursor_update (MetaWaylandSurface *cursor_surface);
|
||||
|
||||
void meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer);
|
||||
|
||||
gboolean meta_wayland_pointer_is_grabbed (MetaWaylandPointer *pointer);
|
||||
|
||||
#endif /* META_WAYLAND_POINTER_H */
|
||||
|
@ -534,3 +534,17 @@ meta_wayland_seat_get_compositor (MetaWaylandSeat *seat)
|
||||
{
|
||||
return seat->compositor;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_seat_is_grabbed (MetaWaylandSeat *seat)
|
||||
{
|
||||
if (meta_wayland_seat_has_pointer (seat) &&
|
||||
meta_wayland_pointer_is_grabbed (seat->pointer))
|
||||
return TRUE;
|
||||
|
||||
if (meta_wayland_seat_has_keyboard (seat) &&
|
||||
meta_wayland_keyboard_is_grabbed (seat->keyboard))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -84,4 +84,6 @@ gboolean meta_wayland_seat_has_touch (MetaWaylandSeat *seat);
|
||||
|
||||
MetaWaylandCompositor * meta_wayland_seat_get_compositor (MetaWaylandSeat *seat);
|
||||
|
||||
gboolean meta_wayland_seat_is_grabbed (MetaWaylandSeat *seat);
|
||||
|
||||
#endif /* META_WAYLAND_SEAT_H */
|
||||
|
@ -849,3 +849,9 @@ meta_wayland_compositor_get_context (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
return compositor->context;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_compositor_is_grabbed (MetaWaylandCompositor *compositor)
|
||||
{
|
||||
return meta_wayland_seat_is_grabbed (compositor->seat);
|
||||
}
|
||||
|
@ -103,4 +103,6 @@ META_EXPORT_TEST
|
||||
MetaContext * meta_wayland_compositor_get_context (MetaWaylandCompositor *compositor);
|
||||
|
||||
|
||||
gboolean meta_wayland_compositor_is_grabbed (MetaWaylandCompositor *compositor);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user