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
This commit is contained in:
Jonas Dreßler 2019-04-10 21:28:05 +02:00 committed by Carlos Garnacho
parent a95644dbdc
commit faa7b2d4e5
2 changed files with 9 additions and 0 deletions

View File

@ -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)

View File

@ -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);