+ win *w = find_win (dpy, de->drawable);
+
+ if (!w)
+ return;
+#if CAN_DO_USABLE
+ if (!w->usable)
+ {
+ if (w->damage_bounds.width == 0 || w->damage_bounds.height == 0)
+ {
+ w->damage_bounds = de->area;
+ }
+ else
+ {
+ if (de->area.x < w->damage_bounds.x)
+ {
+ w->damage_bounds.width += (w->damage_bounds.x - de->area.x);
+ w->damage_bounds.x = de->area.x;
+ }
+ if (de->area.y < w->damage_bounds.y)
+ {
+ w->damage_bounds.height += (w->damage_bounds.y - de->area.y);
+ w->damage_bounds.y = de->area.y;
+ }
+ if (de->area.x + de->area.width > w->damage_bounds.x + w->damage_bounds.width)
+ w->damage_bounds.width = de->area.x + de->area.width - w->damage_bounds.x;
+ if (de->area.y + de->area.height > w->damage_bounds.y + w->damage_bounds.height)
+ w->damage_bounds.height = de->area.y + de->area.height - w->damage_bounds.y;
+ }
+#if 0
+ printf ("unusable damage %d, %d: %d x %d bounds %d, %d: %d x %d\n",
+ de->area.x,
+ de->area.y,
+ de->area.width,
+ de->area.height,
+ w->damage_bounds.x,
+ w->damage_bounds.y,
+ w->damage_bounds.width,
+ w->damage_bounds.height);
+#endif
+ if (w->damage_bounds.x <= 0 &&
+ w->damage_bounds.y <= 0 &&
+ w->a.width <= w->damage_bounds.x + w->damage_bounds.width &&
+ w->a.height <= w->damage_bounds.y + w->damage_bounds.height)
+ {
+ clipChanged = True;
+ if (fadeWindows)
+ set_fade (dpy, w, True, 0, False);
+ w->usable = True;
+ }
+ }
+ if (w->usable)
+#endif
+ repair_win (dpy, w);