window-actor: Use logical monitor scale on cursor scale

When using 'scale-monitor-framebuffer', it's important to use the
monitor's scale on top of the cursor texture scale. This matches
what the monitor screencast source does.

Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1541

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2737>
This commit is contained in:
Georges Basile Stavracas Neto 2022-12-03 10:36:26 -03:00
parent 1f705ee10a
commit 381de44c5d

View File

@ -1222,15 +1222,20 @@ meta_window_actor_transform_cursor_position (MetaScreenCastWindow *screen_cast_w
meta_cursor_sprite_get_cogl_texture (cursor_sprite) && meta_cursor_sprite_get_cogl_texture (cursor_sprite) &&
out_cursor_scale) out_cursor_scale)
{ {
MetaShapedTexture *stex; MetaLogicalMonitor *logical_monitor;
double texture_scale; float view_scale;
float cursor_texture_scale; float cursor_texture_scale;
stex = meta_surface_actor_get_texture (priv->surface); logical_monitor = meta_window_get_main_logical_monitor (window);
texture_scale = meta_shaped_texture_get_buffer_scale (stex);
if (meta_is_stage_views_scaled ())
view_scale = meta_logical_monitor_get_scale (logical_monitor);
else
view_scale = 1.0;
cursor_texture_scale = meta_cursor_sprite_get_texture_scale (cursor_sprite); cursor_texture_scale = meta_cursor_sprite_get_texture_scale (cursor_sprite);
*out_cursor_scale = texture_scale / cursor_texture_scale; *out_cursor_scale = view_scale * cursor_texture_scale;
} }
if (cursor_sprite && if (cursor_sprite &&