[mutter] core: Add a helper function to grab the old event mask of a window
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] core: Add a helper function to grab the old event mask of a window
- Date: Thu, 7 Feb 2013 23:13:51 +0000 (UTC)
commit d794db876a396e70faefc0b78c659fda28e1e7e8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Feb 7 17:37:57 2013 -0500
core: Add a helper function to grab the old event mask of a window
https://bugzilla.gnome.org/show_bug.cgi?id=690581
src/core/core.c | 21 +++++++++++++++++++++
src/core/core.h | 8 ++++----
2 files changed, 25 insertions(+), 4 deletions(-)
---
diff --git a/src/core/core.c b/src/core/core.c
index c2ec5fe..7583da1 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -775,3 +775,24 @@ meta_invalidate_default_icons (void)
g_slist_free (windows);
}
+void
+meta_core_add_old_event_mask (Display *xdisplay,
+ Window xwindow,
+ XIEventMask *mask)
+{
+ XIEventMask *prev;
+ gint n_masks, i, j;
+
+ prev = XIGetSelectedEvents (xdisplay, xwindow, &n_masks);
+
+ for (i = 0; i < n_masks; i++)
+ {
+ if (prev[i].deviceid != XIAllMasterDevices)
+ continue;
+
+ for (j = 0; j < MIN (mask->mask_len, prev[i].mask_len); j++)
+ mask->mask[j] |= prev[i].mask[j];
+ }
+
+ XFree (prev);
+}
diff --git a/src/core/core.h b/src/core/core.h
index 12451bd..71bbcd6 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -205,8 +205,8 @@ void meta_core_increment_event_serial (Display *display);
void meta_invalidate_default_icons (void);
-#endif
-
-
-
+void meta_core_add_old_event_mask (Display *xdisplay,
+ Window xwindow,
+ XIEventMask *mask);
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]