display: Ceil pointer cursor theme scale when fractional

The fraction of the scale was accidentally casted away, lets ceil it
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
This commit is contained in:
Jonas Ådahl 2017-10-20 05:00:06 -05:00
parent e4a2d15171
commit c388a8fc9d

View File

@ -1436,7 +1436,7 @@ meta_cursor_for_grab_op (MetaGrabOp op)
return META_CURSOR_DEFAULT; return META_CURSOR_DEFAULT;
} }
static int static float
find_highest_logical_monitor_scale (MetaBackend *backend, find_highest_logical_monitor_scale (MetaBackend *backend,
MetaCursorSprite *cursor_sprite) MetaCursorSprite *cursor_sprite)
{ {
@ -1447,7 +1447,7 @@ find_highest_logical_monitor_scale (MetaBackend *backend,
ClutterRect cursor_rect; ClutterRect cursor_rect;
GList *logical_monitors; GList *logical_monitors;
GList *l; GList *l;
int highest_scale = 0; float highest_scale = 0.0;
cursor_rect = meta_cursor_renderer_calculate_rect (cursor_renderer, cursor_rect = meta_cursor_renderer_calculate_rect (cursor_renderer,
cursor_sprite); cursor_sprite);
@ -1482,13 +1482,18 @@ root_cursor_prepare_at (MetaCursorSpriteXcursor *sprite_xcursor,
if (meta_is_stage_views_scaled ()) if (meta_is_stage_views_scaled ())
{ {
int scale; float scale;
scale = find_highest_logical_monitor_scale (backend, cursor_sprite); scale = find_highest_logical_monitor_scale (backend, cursor_sprite);
if (scale != 0) if (scale != 0.0)
{ {
meta_cursor_sprite_xcursor_set_theme_scale (sprite_xcursor, scale); float ceiled_scale;
meta_cursor_sprite_set_texture_scale (cursor_sprite, 1.0 / scale);
ceiled_scale = ceilf (scale);
meta_cursor_sprite_xcursor_set_theme_scale (sprite_xcursor,
(int) ceiled_scale);
meta_cursor_sprite_set_texture_scale (cursor_sprite,
1.0 / ceiled_scale);
} }
} }
else else