Commit c388a8fc authored by Jonas Ådahl's avatar Jonas Ådahl

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
parent e4a2d151
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment