From faa7b2d4e508fe36a80b22d13f668ee99fa810e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 10 Apr 2019 21:28:05 +0200 Subject: [PATCH] cursor-tracker: Add API to get whether the pointer is visible Allow checking whether the pointer is visible without accessing the trackers internal is_showing property. While we don't need this just yet for reading the visibility inside meta-wayland-pointer, it's useful when implementing the logic to remove Clutter's focus when the cursor goes hidden later. https://gitlab.gnome.org/GNOME/mutter/merge_requests/448 --- src/backends/meta-cursor-tracker.c | 6 ++++++ src/meta/meta-cursor-tracker.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/backends/meta-cursor-tracker.c b/src/backends/meta-cursor-tracker.c index 6b7849d55..88607bf4d 100644 --- a/src/backends/meta-cursor-tracker.c +++ b/src/backends/meta-cursor-tracker.c @@ -418,6 +418,12 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker, get_pointer_position_gdk (x, y, (int*)mods); } +gboolean +meta_cursor_tracker_get_pointer_visible (MetaCursorTracker *tracker) +{ + return tracker->is_showing; +} + void meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, gboolean visible) diff --git a/src/meta/meta-cursor-tracker.h b/src/meta/meta-cursor-tracker.h index 29b1aab5a..2f51115e4 100644 --- a/src/meta/meta-cursor-tracker.h +++ b/src/meta/meta-cursor-tracker.h @@ -55,6 +55,9 @@ void meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker, int *y, ClutterModifierType *mods); +META_EXPORT +gboolean meta_cursor_tracker_get_pointer_visible (MetaCursorTracker *tracker); + META_EXPORT void meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, gboolean visible);