[mutter] Make sure to include the old XI2 mask when selecting for events
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Make sure to include the old XI2 mask when selecting for events
- Date: Thu, 7 Feb 2013 23:13:56 +0000 (UTC)
commit 453020c31589293a5788b36720c1241fd4a8fbde
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Feb 7 17:33:17 2013 -0500
Make sure to include the old XI2 mask when selecting for events
Some windows may already have event masks on them that we've selected
for, especially if we're using GTK+ windows. In particular, this fixes
window menus in the XI2 port.
https://bugzilla.gnome.org/show_bug.cgi?id=690581
src/compositor/compositor.c | 5 +++++
src/core/screen.c | 2 ++
src/core/window.c | 2 ++
3 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c
index 105464f..b92302e 100644
--- a/src/compositor/compositor.c
+++ b/src/compositor/compositor.c
@@ -4,6 +4,7 @@
#include <clutter/x11/clutter-x11.h>
+#include "core.h"
#include <meta/screen.h>
#include <meta/errors.h>
#include <meta/window.h>
@@ -163,6 +164,8 @@ get_output_window (MetaScreen *screen)
xroot = meta_screen_get_xroot (screen);
output = XCompositeGetOverlayWindow (xdisplay, xroot);
+ meta_core_add_old_event_mask (xdisplay, output, &mask);
+
XISetMask (mask.mask, XI_KeyPress);
XISetMask (mask.mask, XI_KeyRelease);
XISetMask (mask.mask, XI_ButtonPress);
@@ -550,6 +553,8 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
XWindowAttributes attr;
+ meta_core_add_old_event_mask (xdisplay, xwin, &mask);
+
XISetMask (mask.mask, XI_KeyPress);
XISetMask (mask.mask, XI_KeyRelease);
XISetMask (mask.mask, XI_ButtonPress);
diff --git a/src/core/screen.c b/src/core/screen.c
index 4b41dc3..73d7173 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -748,6 +748,8 @@ meta_screen_new (MetaDisplay *display,
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
XWindowAttributes attr;
+ meta_core_add_old_event_mask (xdisplay, xroot, &mask);
+
XISetMask (mask.mask, XI_KeyPress);
XISetMask (mask.mask, XI_KeyRelease);
XISetMask (mask.mask, XI_Enter);
diff --git a/src/core/window.c b/src/core/window.c
index ead4d81..e669fa7 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -939,6 +939,8 @@ meta_window_new_with_attrs (MetaDisplay *display,
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
+ meta_core_add_old_event_mask (display->xdisplay, xwindow, &mask);
+
XISetMask (mask.mask, XI_Enter);
XISetMask (mask.mask, XI_Leave);
XISetMask (mask.mask, XI_FocusIn);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]