mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
clutter/backend: Introduce a fallback scale set to primary monitor scale
Add private API to ClutterBackend to set a fallback resource scale available to Clutter. This API will be used for "guessing" the resource-scale of ClutterActors in case the actor is not attached to a stage or not properly positioned yet. We set this value from inside mutters MetaRenderer while creating new stage-views for each logical monitor. This makes it possible to set the fallback scale to the scale of the primary monitor, which is the monitor where most ClutterActors are going to be positioned. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1276
This commit is contained in:

committed by
Jonas Ådahl

parent
162aec7802
commit
802b24a640
@ -153,6 +153,19 @@ meta_renderer_real_rebuild_views (MetaRenderer *renderer)
|
||||
{
|
||||
MetaLogicalMonitor *logical_monitor = l->data;
|
||||
|
||||
if (meta_logical_monitor_is_primary (logical_monitor))
|
||||
{
|
||||
ClutterBackend *clutter_backend;
|
||||
float scale;
|
||||
|
||||
clutter_backend = meta_backend_get_clutter_backend (backend);
|
||||
scale = meta_is_stage_views_scaled ()
|
||||
? meta_logical_monitor_get_scale (logical_monitor)
|
||||
: 1.f;
|
||||
|
||||
clutter_backend_set_fallback_resource_scale (clutter_backend, scale);
|
||||
}
|
||||
|
||||
meta_logical_monitor_foreach_crtc (logical_monitor,
|
||||
create_crtc_view,
|
||||
renderer);
|
||||
|
Reference in New Issue
Block a user