[PATCH weston] xwm: Fix opaque region system.

Scott Moreau oreaus at gmail.com
Thu Nov 22 14:35:13 PST 2012


Since surface.commit was introduced, opqaue regions are stored in a pending
variable that isn't used until surface.commit. Xwayland uses the surface opaque
region as a way to tell weston what region of the surface should be opaque.
However when this pending opaque region was introduced, xwm was not updated
and so we have the 'black = transparent' problem again. This patch fixes the
problem by having xwm use the pending opaque regions.
---

Hi, I noticed this broke again and fixed it here. However, now I'm wondering
if weston_surface needs an opaque region at all anymore. It seems the only thing
that uses it is weston_surface_update_transform_disable(). I'm not sure if this
is the best fix but the opaque region system could use a closer examination
now that surface.commit is in place.

 src/xwayland/window-manager.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 57b4e3c..1b2c0da 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -745,15 +745,15 @@ weston_wm_window_draw_decoration(void *data)
 	cairo_destroy(cr);
 
 	if (window->surface) {
-		pixman_region32_fini(&window->surface->opaque);
-		pixman_region32_init_rect(&window->surface->opaque, 0, 0,
+		pixman_region32_fini(&window->surface->pending.opaque);
+		pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
 					  width, height);
 
 		/* 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_intersect_rect(&window->surface->opaque,
-					       &window->surface->opaque,
+		pixman_region32_intersect_rect(&window->surface->pending.opaque,
+					       &window->surface->pending.opaque,
 					       x - 1, y - 1,
 					       window->width + 2,
 					       window->height + 2);
@@ -775,8 +775,8 @@ weston_wm_window_schedule_repaint(struct weston_wm_window *window)
 	if (window->frame_id == XCB_WINDOW_NONE) {
 		if (window->surface != NULL) {
 			weston_wm_window_get_frame_size(window, &width, &height);
-			pixman_region32_fini(&window->surface->opaque);
-			pixman_region32_init_rect(&window->surface->opaque, 0, 0,
+			pixman_region32_fini(&window->surface->pending.opaque);
+			pixman_region32_init_rect(&window->surface->pending.opaque, 0, 0,
 						  width, height);
 			window->surface->geometry.dirty = 1;
 		}
-- 
1.7.11.7



More information about the wayland-devel mailing list