summaryrefslogtreecommitdiff
path: root/src/util/ui.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/ui.vala')
-rw-r--r--src/util/ui.vala17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/ui.vala b/src/util/ui.vala
index e1c22f1..7e7348f 100644
--- a/src/util/ui.vala
+++ b/src/util/ui.vala
@@ -86,3 +86,20 @@ public bool has_only_key_modifier(Gdk.ModifierType field, Gdk.ModifierType mask)
| Gdk.ModifierType.META_MASK)) == mask;
}
+#if ENABLE_FACES
+bool is_pointer_over(Gdk.Window window) {
+ Gdk.DeviceManager? devmgr = window.get_display().get_device_manager();
+ if (devmgr == null) {
+ debug("No device for display");
+
+ return false;
+ }
+
+ int x, y;
+ devmgr.get_client_pointer().get_position(null, out x, out y);
+ //gdk_device_get_position(devmgr.get_client_pointer(), null, out x, out y);
+
+ return x >= 0 && y >= 0 && x < window.get_width() && y < window.get_height();
+}
+#endif
+