From 31876db9637c0517a4f1c98a29192ac417953d94 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Mon, 27 Apr 2009 21:47:28 +0400 Subject: [PATCH] XFWM: rebuild all compositor screens on startup When some windows are already started prior to xfwm startup (for example, I have xfce-panel started prior to xfwm) and screen compositing is enabled, these existings windows receive whitish shadows that aren't disappear after their movements and root window is damaged by these shadow remains. The reason is simple: existing windows aren't catched by compositor. The easiest route to fix this is to rebuild all screens in compositor after xfwm startup -- this will fix the things and all shadows will behave properly. Signed-off-by: Eygene Ryabinkin --- src/compositor.c | 17 +++++++++++++++++ src/compositor.h | 1 + src/main.c | 3 +++ 3 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 301de23..d3e7152 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -3214,6 +3214,23 @@ compositorRebuildScreen (ScreenInfo *screen_info) #endif /* HAVE_COMPOSITOR */ } +void +compositorRebuildAllScreens (DisplayInfo *display_info) +{ +#ifdef HAVE_COMPOSITOR + GSList *screens; + + g_return_if_fail (display_info != NULL); + TRACE ("entering compositorRebuildAllScreens"); + + for (screens = display_info->screens; + screens; + screens = g_slist_next (screens)) { + compositorRebuildScreen ((ScreenInfo *)screens->data); + } +#endif /* HAVE_COMPOSITOR */ +} + gboolean compositorTestServer (DisplayInfo *display_info) { diff --git a/src/compositor.h b/src/compositor.h index 9bb778b..0746a75 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -68,6 +68,7 @@ void compositorWindowSetOpacity (DisplayInfo *, Window, guint); void compositorRebuildScreen (ScreenInfo *); +void compositorRebuildAllScreens (DisplayInfo *); gboolean compositorTestServer (DisplayInfo *); #endif /* INC_COMPOSITOR_H */ diff --git a/src/main.c b/src/main.c index d04df61..a47deec 100644 --- a/src/main.c +++ b/src/main.c @@ -527,6 +527,9 @@ initialize (int argc, char **argv, gint compositor_mode, gboolean replace_wm) display_info->xfilter = eventFilterInit ((gpointer) display_info); eventFilterPush (display_info->xfilter, xfwm4_event_filter, (gpointer) display_info); + /* Rebuild all screens to make compositor catch existing windows */ + compositorRebuildAllScreens (display_info); + return sessionStart (argc, argv, display_info); } -- 1.6.2.4