GNOME Bugzilla – Bug 744933
Wrong input region on wayland in HiDPI
Last modified: 2015-03-03 20:03:45 UTC
Testing gnome-control-center 3.15.90 in wayland on a HiDPI screen, I found that for some reason it reports an invalid input region, meaning that only the upper left half of the window can be interacted with and will be repainted. Interestingly, only this portion of the window is repainted correctly, the rest has the grey GDK background, but clicking on any panel gets the previous content in place of the non updated areas. This does not happen in any other app. It does not happen in Xwayland either (although there are other glitches there)
I rectify: this happens in geary too. Reassigning to gtk+.
Seems to work fine in weston and according to WAYLAND_DEBUG it sets correct input regions (although multiple times before a commit which is harmless only a bit unnecessary). It rather seems to be an issue with mutter which doesn't handle region scaling properly, so this bug should probably be moved there (but I can't do that).
thanks, moving it over then
We scale the input region by output_scale / buffer_scale ... so if you have buffer_scale of 1 and output scale of 2 it gets scaled up by 2. If the app sets buffer scale to 2 it gets scaled by 1 (i.e not at all) because the app is supposed to be rendering at the correct resolution. Also is it really "the upper half" or the the "upper left quarter" ? We always scale the opaque region by the buffer scale which looks wrong ... unfortunately can't test it right now does something like this work? : diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index b1364e8..76c1fc1 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -426,7 +426,8 @@ commit_pending_state (MetaWaylandSurface *surface, if (pending->opaque_region) { - pending->opaque_region = scale_region (pending->opaque_region, surface->scale); + pending->opaque_region = scale_region (pending->opaque_region, + meta_surface_actor_wayland_get_scale (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor))); meta_surface_actor_set_opaque_region (surface->surface_actor, pending->opaque_region); } if (pending->input_region)
Its not. That scale might change without the client changing any of its surface state. I have some code that reworks how thatvis handled some. I'll post a patch next week.
Created attachment 298365 [details] [review] wayland: Make the surface actor set its own state Since the surface actor knows more about how it draws itself, instead of pushing texture state (buffer and scale), input region and opaque region from MetaWaylandSurface after having transformed into what the surface actor expects, make the surface actor set its own state given what state the Wayland surface is in.
Created attachment 298366 [details] [review] wayland: Fix surface damage region scales Use the correct scale when processing damage from the client.
Created attachment 298367 [details] [review] wayland: Sync surface actor state when changing main monitor In order to switch to the correct surface actor scale given the monitor the surface is on, without relying on the client committing a new state given some other side effect, sync the surface actor state when the main monitor associated with the corresponding window changed.
Review of attachment 298365 [details] [review]: Makes sense.
Review of attachment 298366 [details] [review]: LG.
Review of attachment 298367 [details] [review]: OK.
(pushing now so this stuff makes it into tonight's release) Attachment 298365 [details] pushed as bbcee17 - wayland: Make the surface actor set its own state Attachment 298366 [details] pushed as adf7c0e - wayland: Fix surface damage region scales Attachment 298367 [details] pushed as fffb863 - wayland: Sync surface actor state when changing main monitor