# HG changeset patch # User nenolod # Date 1148068082 25200 # Node ID d94ba9133f94cd5a71ccd679f614bba89dd0443d # Parent 069d4503ce5475577fb4462978b78ae6ce2e255f [svn] - update transparency pixmap if root window pixmap changes diff -r 069d4503ce54 -r d94ba9133f94 audacious/playlist_list.c --- a/audacious/playlist_list.c Fri May 19 12:24:07 2006 -0700 +++ b/audacious/playlist_list.c Fri May 19 12:48:02 2006 -0700 @@ -62,6 +62,8 @@ GdkPixmap *rootpix; +void playlist_list_draw(Widget * w); + /* Sort of stolen from XChat, but not really, as theres uses Xlib */ static void shade_gdkimage_generic (GdkVisual *visual, GdkImage *ximg, int bpl, int w, int h, int rm, int gm, int bm, int bg) @@ -145,6 +147,30 @@ return retval; } +static GdkFilterReturn +root_event_cb (GdkXEvent *xev, GdkEventProperty *event, gpointer data) +{ + static Atom at = None; + XEvent *xevent = (XEvent *)xev; + + if (xevent->type == PropertyNotify) + { + if (at == None) + at = XInternAtom (xevent->xproperty.display, "_XROOTPMAP_ID", True); + + if (at == xevent->xproperty.atom) + { + rootpix = shade_pixmap(get_transparency_pixmap(), 0, 0, 0, 0, gdk_screen_width(), gdk_screen_height(), + skin_get_color(bmp_active_skin, SKIN_PLEDIT_NORMALBG)); + + if (cfg.playlist_transparent) + playlist_list_draw(WIDGET(data)); + } + } + + return GDK_FILTER_CONTINUE; +} + #else GdkPixmap *get_transparency_pixmap(void) @@ -849,6 +875,11 @@ widget_list_add(wlist, WIDGET(pl)); +#ifdef GDK_WINDOWING_X11 + gdk_window_set_events (gdk_get_default_root_window(), GDK_PROPERTY_CHANGE_MASK); + gdk_window_add_filter (gdk_get_default_root_window(), (GdkFilterFunc)root_event_cb, pl); +#endif + return pl; }