After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706289 - meta-wayland: intersect the damage region with the window size before applying
meta-wayland: intersect the damage region with the window size before applying
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-08-19 09:28 UTC by Giovanni Campagna
Modified: 2013-09-03 14:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meta-wayland: intersect the damage region with the window size before applying (1.63 KB, patch)
2013-08-19 09:28 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-08-19 09:28:22 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.
Comment 1 Giovanni Campagna 2013-08-19 09:28:25 UTC
Created attachment 252187 [details] [review]
meta-wayland: intersect the damage region with the window size before applying
Comment 2 Neil Roberts 2013-08-28 16:08:33 UTC
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;
Comment 3 Giovanni Campagna 2013-08-28 16:10:54 UTC
Uh, yeah, sorry, I had spotted that problem too, but I forgot to attach the updated patch...
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-09-03 14:21:13 UTC
Attachment 252187 [details] pushed as cbe5b6b - meta-wayland: intersect the damage region with the window size before applying


reviewed on irc