mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
wayland: Keep pointer_output_scale as double
We can round up to the next integer when we need to.
This commit is contained in:
parent
a98e6bff85
commit
67a6f343a0
@ -69,7 +69,7 @@ struct _GdkWaylandPointerData {
|
||||
guint cursor_image_delay;
|
||||
guint touchpad_event_sequence;
|
||||
|
||||
guint current_output_scale;
|
||||
double current_output_scale;
|
||||
GSList *pointer_surface_outputs;
|
||||
|
||||
/* Accumulated event data for a pointer frame */
|
||||
|
@ -271,7 +271,7 @@ gdk_wayland_device_update_surface_cursor (GdkDevice *device)
|
||||
{
|
||||
buffer = _gdk_wayland_cursor_get_buffer (GDK_WAYLAND_DISPLAY (seat->display),
|
||||
pointer->cursor,
|
||||
pointer->current_output_scale,
|
||||
(int) ceil (pointer->current_output_scale),
|
||||
pointer->cursor_image_index,
|
||||
&x, &y, &w, &h, &scale);
|
||||
}
|
||||
|
@ -3767,8 +3767,7 @@ pointer_surface_update_scale (GdkDevice *device)
|
||||
GdkWaylandDevice *wayland_device = GDK_WAYLAND_DEVICE (device);
|
||||
GdkWaylandPointerData *pointer =
|
||||
gdk_wayland_device_get_pointer (wayland_device);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
guint32 scale;
|
||||
double scale;
|
||||
GSList *l;
|
||||
|
||||
if (wl_surface_get_version (pointer->pointer_surface) < WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION)
|
||||
@ -3783,8 +3782,8 @@ pointer_surface_update_scale (GdkDevice *device)
|
||||
scale = 1;
|
||||
for (l = pointer->pointer_surface_outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale = gdk_wayland_display_get_output_scale (display_wayland, l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
GdkMonitor *monitor = gdk_wayland_display_get_monitor_for_output (seat->display, l->data);
|
||||
scale = MAX (scale, gdk_monitor_get_scale (monitor));
|
||||
}
|
||||
|
||||
if (pointer->current_output_scale == scale)
|
||||
|
Loading…
Reference in New Issue
Block a user