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:
@ -220,19 +220,21 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
|||||||
|
|
||||||
image = wayland_cursor->wl_cursor->images[image_index];
|
image = wayland_cursor->wl_cursor->images[image_index];
|
||||||
|
|
||||||
*hotspot_x = image->hotspot_x;
|
*hotspot_x = image->hotspot_x / wayland_cursor->scale;
|
||||||
*hotspot_y = image->hotspot_y;
|
*hotspot_y = image->hotspot_y / wayland_cursor->scale;
|
||||||
|
|
||||||
*w = image->width;
|
*w = image->width / wayland_cursor->scale;
|
||||||
*h = image->height;
|
*h = image->height / wayland_cursor->scale;
|
||||||
*scale = wayland_cursor->scale;
|
*scale = wayland_cursor->scale;
|
||||||
|
|
||||||
return wl_cursor_image_get_buffer (image);
|
return wl_cursor_image_get_buffer (image);
|
||||||
}
|
}
|
||||||
else if (wayland_cursor->name == NULL) /* From surface */
|
else if (wayland_cursor->name == NULL) /* From surface */
|
||||||
{
|
{
|
||||||
*hotspot_x = wayland_cursor->surface.hotspot_x;
|
*hotspot_x =
|
||||||
*hotspot_y = wayland_cursor->surface.hotspot_y;
|
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;
|
*w = wayland_cursor->surface.width / wayland_cursor->surface.scale;
|
||||||
*h = wayland_cursor->surface.height / wayland_cursor->surface.scale;
|
*h = wayland_cursor->surface.height / wayland_cursor->surface.scale;
|
||||||
|
|||||||
Reference in New Issue
Block a user