GNOME Bugzilla – Bug 706289
meta-wayland: intersect the damage region with the window size before applying
Last modified: 2013-09-03 14:21:16 UTC
According to the wayland documentation, damage outside the window size is ignored. This happened with xwayland+wlshm (causing a GL error when calling TexSubImage2D), probably due to not resizing the buffer until we receive the corresponding X event. Might also be an off-by-one in xwayland, as the window size did not actually change. Note: we might want to take the configure_notify path instead, and keep the GL/clutter size consistent with wayland rather than X, because in the end that's what matters for events and composition.
Created attachment 252187 [details] [review] meta-wayland: intersect the damage region with the window size before applying
I think this patch isn't quite right because the coordinates returned by meta_window_get_input_rect are relative to the root window whereas the coordinates in the damage rectangle are relative to the surface. Therefore the damage regions would always end up being intersected to zero. I think we just need to change it to only consider the width and height rather than the position like so: diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 1c84314..ddec411 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -217,8 +217,8 @@ surface_process_damage (MetaWaylandSurface *surface, cairo_rectangle_int_t cairo_rect; meta_window_get_input_rect (surface->window, &rect); - cairo_rect.x = rect.x; - cairo_rect.y = rect.y; + cairo_rect.x = 0; + cairo_rect.y = 0; cairo_rect.width = rect.width; cairo_rect.height = rect.height;
Uh, yeah, sorry, I had spotted that problem too, but I forgot to attach the updated patch...
Attachment 252187 [details] pushed as cbe5b6b - meta-wayland: intersect the damage region with the window size before applying reviewed on irc