static void render_update_picture(d_window_t *w, data_t *d, window_data_t *wd);
static void render_update_root_picture(d_screen_t *sc, data_t *d);
static void render_free_picture(d_window_t *w, window_data_t *wd);
+static void render_redraw_window(d_window_t *w, data_t *d,
+ gboolean shadow, window_data_t *wd);
static xcb_render_pictformat_t find_visual_format(data_t *d,
xcb_visualid_t visual);
static xcb_render_pictformat_t find_argb32_format(data_t *d);
d = screen_find_plugin_data(w->sc, plugin_id);
wd = window_find_plugin_data(w, plugin_id);
if (wd) {
- /* make sure the shadow region is right */
- render_update_shadow(w, d, wd);
-
- /* redraw the window's area, and its shadow's as well */
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- window_get_region(w), d->damaged_region);
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- wd->shadow_region, d->damaged_region);
+ /* redraw the window and its shadow */
+ render_redraw_window(w, d, TRUE, wd);
render_window_free(w, wd);
window_remove_plugin_data(w, plugin_id);
d->window_reshape(w);
assert(wd != NULL);
- render_free_picture(w, wd);
+ //render_free_picture(w, wd);
/* redraw the screen */
xcb_xfixes_copy_region(w->sc->dpy->conn, d->all_region, d->damaged_region);
/* the window might not be visible */
if (wd == NULL) return;
- /* make sure the shadow region is right */
- render_update_shadow(w, d, wd);
+ /* redraw the window and its shadow */
+ render_redraw_window(w, d, TRUE, wd);
+}
+
+/* wd is only needed if redrawing the shadow */
+static void
+render_redraw_window(d_window_t *w, data_t *d,
+ gboolean shadow, window_data_t *wd)
+{
+ xcb_xfixes_region_t region = window_get_region(w);
- /* redraw the window's contents, and its shadow as well */
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- window_get_region(w), d->damaged_region);
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- wd->shadow_region, d->damaged_region);
+ if (region) {
+ /* redraw the window's contents, and its shadow as well */
+ xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
+ region, d->damaged_region);
+
+ if (shadow) {
+ /* make sure the shadow region is right */
+ render_update_shadow(w, d, wd);
+ xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
+ wd->shadow_region, d->damaged_region);
+ }
+ }
+ else {
+ /* redraw the screen */
+ xcb_xfixes_copy_region(w->sc->dpy->conn, d->all_region,
+ d->damaged_region);
+ }
}
static void
/* update the window and its shadows opacities */
render_update_opacity(w, d, wd);
- /* make sure the shadow region is right */
- render_update_shadow(w, d, wd);
-
- /* redraw the window's contents, and its shadow as well */
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- window_get_region(w), d->damaged_region);
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- wd->shadow_region, d->damaged_region);
+ /* redraw the window and its shadow */
+ render_redraw_window(w, d, TRUE, wd);
//printf("opacity change 0x%x\n", w->id);
}
/* pass it on */
d->window_damage(w);
- /* redraw the window's contents */
- xcb_xfixes_union_region(w->sc->dpy->conn, d->damaged_region,
- window_get_region(w), d->damaged_region);
+ /* redraw the window not not its shadow */
+ render_redraw_window(w, d, FALSE, NULL);
}
static void