diff --git a/src/core/display.c b/src/core/display.c index 1c80b3939..1531fc945 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -1436,7 +1436,7 @@ meta_cursor_for_grab_op (MetaGrabOp op) return META_CURSOR_DEFAULT; } -static int +static float find_highest_logical_monitor_scale (MetaBackend *backend, MetaCursorSprite *cursor_sprite) { @@ -1447,7 +1447,7 @@ find_highest_logical_monitor_scale (MetaBackend *backend, ClutterRect cursor_rect; GList *logical_monitors; GList *l; - int highest_scale = 0; + float highest_scale = 0.0; cursor_rect = meta_cursor_renderer_calculate_rect (cursor_renderer, cursor_sprite); @@ -1482,13 +1482,18 @@ root_cursor_prepare_at (MetaCursorSpriteXcursor *sprite_xcursor, if (meta_is_stage_views_scaled ()) { - int scale; + float scale; 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); - meta_cursor_sprite_set_texture_scale (cursor_sprite, 1.0 / scale); + float ceiled_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