run_fades (Display *dpy)
{
int now = get_time_in_milliseconds();
- fade *f, *next;
+ fade *next = fades;
int steps;
Bool need_dequeue;
if (fade_time - now > 0)
return;
steps = 1 + (now - fade_time) / fade_delta;
- for (next = fades; f = next; )
+
+ while (next)
{
+ fade *f = next;
win *w = f->w;
next = f->next;
f->cur += f->step * steps;
return 0;
}
-static char *backgroundProps[] = {
+static const char *backgroundProps[] = {
"_XROOTPMAP_ID",
"_XSETROOT_ID",
0,
#endif
w->damaged = 0;
+#if HAS_NAME_WINDOW_PIXMAP
+ /* If the window was previously mapped and its pixmap still exists, it
+ is out of date now, so force us to reacquire it. (If the window
+ re-maps before the unmap fade-out finished) */
+ if (w->pixmap)
+ {
+ XFreePixmap (dpy, w->pixmap);
+ w->pixmap = None;
+ }
+#endif
+
if (fade && fadeWindows)
set_fade (dpy, w, 0, get_opacity_percent (dpy, w, 1.0), fade_in_step, 0, False, True, True);
}
}
w->a.x = ce->x;
w->a.y = ce->y;
- if (w->a.width != ce->width || w->a.height != ce->height)
+ /* Only destroy the pixmap if the window is mapped */
+ if (w->a.map_state != IsUnmapped &&
+ (w->a.width != ce->width || w->a.height != ce->height))
{
#if HAS_NAME_WINDOW_PIXMAP
if (w->pixmap)
w->a.border_width = ce->border_width;
w->a.override_redirect = ce->override_redirect;
restack_win (dpy, w, ce->above);
- if (damage)
+ if (w->a.map_state != IsUnmapped && damage)
{
XserverRegion extents = win_extents (dpy, w);
XFixesUnionRegion (dpy, damage, damage, extents);
XRenderFreePicture (dpy, w->shadowPict);
w->shadowPict = None;
}
+ if (w->shadow)
+ {
+ XRenderFreePicture (dpy, w->shadow);
+ w->shadow = None;
+ }
if (w->damage != None)
{
set_ignore (dpy, NextRequest (dpy));
win *w = find_win (dpy, id);
#if HAS_NAME_WINDOW_PIXMAP
if (w && w->pixmap && fade && fadeWindows)
- set_fade (dpy, w, w->opacity*1.0/OPAQUE, 0.0, fade_out_step, destroy_callback, gone, False, True);
+ set_fade (dpy, w, w->opacity*1.0/OPAQUE, 0.0, fade_out_step,
+ destroy_callback, gone, False,
+ (w->a.map_state != IsUnmapped));
else
#endif
{
error (Display *dpy, XErrorEvent *ev)
{
int o;
- char *name = 0;
+ const char *name = 0;
if (should_ignore (dpy, ev->serial))
return 0;