From 432ad0f4512eb7456428a34951b38910a0676f45 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Fri, 1 May 2009 18:35:55 -0400 Subject: [PATCH] Avoid clobbering the root window event mask Calling gdk_window_get_events() then gdk_window_set_events() will remove "exotic" X event masks that GDK doesn't know about like SubstructureRedirectMask. A window manager that doesn't select for SubstructureRedirectMask on the root window is no longer really a window manager, so various Bad Things were happening. We can just piggy-back on Mutter selecting for PropertyNotify events on the root window, so removing the code works fine. http://bugzilla.gnome.org/show_bug.cgi?id=580572 (reported by Mike Bursell) --- src/shell-global.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/shell-global.c b/src/shell-global.c index 0857e984b..01ca0db0e 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -1170,7 +1170,6 @@ ClutterActor * shell_global_create_root_pixmap_actor (ShellGlobal *global) { GdkWindow *window; - GdkEventMask events; gboolean created_new_pixmap = FALSE; ClutterActor *clone; @@ -1190,16 +1189,16 @@ shell_global_create_root_pixmap_actor (ShellGlobal *global) g_signal_connect (G_OBJECT (global->root_pixmap), "destroy", G_CALLBACK (root_pixmap_destroy), global); - /* Watch the root window for changes. */ - window = gdk_get_default_root_window (); - events = gdk_window_get_events (window); - events |= GDK_PROPERTY_CHANGE_MASK; - gdk_window_set_events (window, events); - /* Metacity handles some root window property updates in its global - * event filter, though not this one. For all root window property - * updates, the global filter returns GDK_FILTER_CONTINUE, so our - * window specific filter will be called. + /* Metacity handles changes to some root window properties in its global + * event filter, though not _XROOTPMAP_ID. For all root window property + * changes, the global filter returns GDK_FILTER_CONTINUE, so our + * window specific filter will be called after the global one. + * + * Because Metacity is already handling root window property updates, + * we don't have to worry about adding the PropertyChange mask to the + * root window to get PropertyNotify events. */ + window = gdk_get_default_root_window (); gdk_window_add_filter (window, root_window_filter, global); update_root_window_pixmap (global);