summaryrefslogtreecommitdiff
path: root/src/gtk-window-decorator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gtk-window-decorator.c')
-rw-r--r--src/gtk-window-decorator.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/gtk-window-decorator.c b/src/gtk-window-decorator.c
index 53a1293..9f895d9 100644
--- a/src/gtk-window-decorator.c
+++ b/src/gtk-window-decorator.c
@@ -181,6 +181,7 @@ GdkPixmap *switcher_buffer_pixmap = NULL;
gint switcher_width;
gint switcher_height;
Window switcher_selected_window = None;
+decor_t *switcher_window = NULL;
XRenderPictFormat *xformat_rgba;
XRenderPictFormat *xformat_rgb;
@@ -193,6 +194,9 @@ main (int argc, char *argv[])
GdkScreen *gdkscreen;
WnckScreen *screen;
gint i, j, status;
+ unsigned int nchildren;
+ Window root_ret, parent_ret;
+ Window *children = NULL;
gboolean replace = FALSE;
#ifdef USE_METACITY
@@ -389,9 +393,34 @@ main (int argc, char *argv[])
if (!minimal)
{
+ GdkWindow *root = gdk_window_foreign_new_for_display (gdkdisplay,
+ gdk_x11_get_default_root_xwindow ());
+
gdk_window_add_filter (NULL,
event_filter_func,
NULL);
+
+ XQueryTree (xdisplay, gdk_x11_get_default_root_xwindow (),
+ &root_ret, &parent_ret, &children, &nchildren);
+
+ for (i = 0; i < nchildren; i++)
+ {
+ GdkWindow *toplevel = gdk_window_foreign_new_for_display (gdkdisplay,
+ children[i]);
+
+ /* Need property notify on all windows */
+
+ gdk_window_set_events (toplevel,
+ gdk_window_get_events (toplevel) |
+ GDK_PROPERTY_CHANGE_MASK);
+ }
+
+ /* Need MapNotify on new windows */
+ gdk_window_set_events (root, gdk_window_get_events (root) |
+ GDK_STRUCTURE_MASK |
+ GDK_PROPERTY_CHANGE_MASK |
+ GDK_VISIBILITY_NOTIFY_MASK |
+ GDK_SUBSTRUCTURE_MASK);
connect_screen (screen);
}