[PATCH 3/3] xwm: Don't set opaque region to cover window contents from X

MoD mod-oss at hush.ai
Tue Jun 11 18:01:03 PDT 2013


Window contents cannot be assumed to be fully opaque for windows drawn with
a RGBA visual. Later the optimization of setting a full opaque region can
be reimplemented after checking that the windows involved aren't using RGBA
visuals.

The comment mentioning sampling of undefined alpha channel was irrelevant as
of f91871980e095caa827f4f39e6c178fc0a2bd396 and can safely be removed.
---
 src/xwayland/window-manager.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index d4be4ca..68bc123 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -830,13 +830,8 @@ weston_wm_window_draw_decoration(void *data)
 
 	if (window->surface) {
 		pixman_region32_fini(&window->surface->pending.opaque);
-		/* We leave an extra pixel around the X window area to
-		 * make sure we don't sample from the undefined alpha
-		 * channel when filtering. */
-		pixman_region32_init_rect(&window->surface->pending.opaque, 
-					  x - 1, y - 1,
-					  window->width + 2,
-					  window->height + 2);
+		pixman_region32_init(&window->surface->pending.opaque);
+		/* TODO: fill opaque region if client doesn't use 32-bit visual */
 		weston_surface_geometry_dirty(window->surface);
 	}
 
@@ -859,8 +854,8 @@ weston_wm_window_schedule_repaint(struct weston_wm_window *window)
 		if (window->surface != NULL) {
 			weston_wm_window_get_frame_size(window, &width, &height);
 			pixman_region32_fini(&window->surface->pending.opaque);
-			pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
-						  width, height);
+			pixman_region32_init(&window->surface->pending.opaque);
+			/* TODO: fill opaque region if client doesn't use 32-bit visual */
 			weston_surface_geometry_dirty(window->surface);
 		}
 		return;
-- 
1.8.3



More information about the wayland-devel mailing list