diff --git a/clutter/clutter/clutter-backend-private.h b/clutter/clutter/clutter-backend-private.h index c7c54f85b..d5dca0d25 100644 --- a/clutter/clutter/clutter-backend-private.h +++ b/clutter/clutter/clutter-backend-private.h @@ -53,6 +53,8 @@ struct _ClutterBackend gfloat units_per_em; gint32 units_serial; + float fallback_resource_scale; + ClutterStageWindow *stage_window; ClutterInputMethod *input_method; @@ -134,6 +136,12 @@ void clutter_set_allowed_drivers (const c CLUTTER_EXPORT ClutterStageWindow * clutter_backend_get_stage_window (ClutterBackend *backend); +CLUTTER_EXPORT +void clutter_backend_set_fallback_resource_scale (ClutterBackend *backend, + float fallback_resource_scale); + +float clutter_backend_get_fallback_resource_scale (ClutterBackend *backend); + G_END_DECLS #endif /* __CLUTTER_BACKEND_PRIVATE_H__ */ diff --git a/clutter/clutter/clutter-backend.c b/clutter/clutter/clutter-backend.c index 3cc4ca297..20d896115 100644 --- a/clutter/clutter/clutter-backend.c +++ b/clutter/clutter/clutter-backend.c @@ -1031,3 +1031,16 @@ clutter_backend_get_default_seat (ClutterBackend *backend) return CLUTTER_BACKEND_GET_CLASS (backend)->get_default_seat (backend); } + +void +clutter_backend_set_fallback_resource_scale (ClutterBackend *backend, + float fallback_resource_scale) +{ + backend->fallback_resource_scale = fallback_resource_scale; +} + +float +clutter_backend_get_fallback_resource_scale (ClutterBackend *backend) +{ + return backend->fallback_resource_scale; +} diff --git a/src/backends/meta-renderer.c b/src/backends/meta-renderer.c index b5cc37efb..e0107ec9d 100644 --- a/src/backends/meta-renderer.c +++ b/src/backends/meta-renderer.c @@ -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);