wayland: Always apply scaling factor to cursor hotspot and dimension

Prior to this patch, the hotspot would be passed in buffer coordinate
space. Where this were ever tested, i.e. in a patched mutter, the
server interpreted them incorrectly, which meant it went undiscovered.
In the updated mutter patches the incorrect behavior in GTK+ was
discovered due to the behavior in mutter was corrected.

In the themed cursor case, the dimensions were not correctly scaled
either, but this had no negative visible effect because the dimension is
only used for reporting damage tracking, and passing a bigger damage
region than surface has no negative visible effects.

https://bugzilla.gnome.org/show_bug.cgi?id=752616
This commit is contained in:
Jonas Ådahl
2015-07-20 16:01:32 +08:00
parent ddcb309b5b
commit 2943bfef46

View File

@ -220,19 +220,21 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
image = wayland_cursor->wl_cursor->images[image_index];
*hotspot_x = image->hotspot_x;
*hotspot_y = image->hotspot_y;
*hotspot_x = image->hotspot_x / wayland_cursor->scale;
*hotspot_y = image->hotspot_y / wayland_cursor->scale;
*w = image->width;
*h = image->height;
*w = image->width / wayland_cursor->scale;
*h = image->height / wayland_cursor->scale;
*scale = wayland_cursor->scale;
return wl_cursor_image_get_buffer (image);
}
else if (wayland_cursor->name == NULL) /* From surface */
{
*hotspot_x = wayland_cursor->surface.hotspot_x;
*hotspot_y = wayland_cursor->surface.hotspot_y;
*hotspot_x =
wayland_cursor->surface.hotspot_x / wayland_cursor->surface.scale;
*hotspot_y =
wayland_cursor->surface.hotspot_y / wayland_cursor->surface.scale;
*w = wayland_cursor->surface.width / wayland_cursor->surface.scale;
*h = wayland_cursor->surface.height / wayland_cursor->surface.scale;