[gnome-flashback/wip/muktupavels/issue-81: 3/3] wm: do not unset existing event mask




commit 681afe66e08d7f9bdb371f947ff6b824a113cbf9
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Fri Jun 3 12:51:13 2022 +0300

    wm: do not unset existing event mask
    
    GTK requests/needs StructureNotifyMask events for XSettings. Make
    sure that existing even mask is not unset while we are requesting
    PropertyChangeMask events.
    
    https://gitlab.gnome.org/GNOME/gnome-flashback/-/issues/81

 gnome-flashback/gf-wm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gnome-flashback/gf-wm.c b/gnome-flashback/gf-wm.c
index f96ec0a..352fd28 100644
--- a/gnome-flashback/gf-wm.c
+++ b/gnome-flashback/gf-wm.c
@@ -274,9 +274,12 @@ gf_wm_init (GfWm *self)
 {
   GdkDisplay *display;
   Display *xdisplay;
+  Window xroot;
+  XWindowAttributes attrs;
 
   display = gdk_display_get_default ();
   xdisplay = gdk_x11_display_get_xdisplay (display);
+  xroot = DefaultRootWindow (xdisplay);
 
   self->wm_check_atom = XInternAtom (xdisplay,
                                      "_NET_SUPPORTING_WM_CHECK",
@@ -286,7 +289,9 @@ gf_wm_init (GfWm *self)
   self->utf8_string_atom = XInternAtom (xdisplay, "UTF8_STRING", False);
 
   gdk_window_add_filter (NULL, event_filter_cb, self);
-  XSelectInput (xdisplay, GDK_ROOT_WINDOW (), PropertyChangeMask);
+
+  XGetWindowAttributes (xdisplay, xroot, &attrs);
+  XSelectInput (xdisplay, xroot, PropertyChangeMask | attrs.your_event_mask);
   XSync (xdisplay, False);
 
   update_wm_check (self);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]