backend: Get 'is-stage-views-scaled' from backend
It did, but used the old backend singleton. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718>
This commit is contained in:
parent
c390f70edc
commit
7e974ba6cc
@ -172,7 +172,7 @@ void meta_backend_set_client_pointer_constraint (MetaBackend *backend,
|
|||||||
|
|
||||||
void meta_backend_monitors_changed (MetaBackend *backend);
|
void meta_backend_monitors_changed (MetaBackend *backend);
|
||||||
|
|
||||||
gboolean meta_is_stage_views_scaled (void);
|
gboolean meta_backend_is_stage_views_scaled (MetaBackend *backend);
|
||||||
|
|
||||||
MetaInputMapper *meta_backend_get_input_mapper (MetaBackend *backend);
|
MetaInputMapper *meta_backend_get_input_mapper (MetaBackend *backend);
|
||||||
MetaInputSettings *meta_backend_get_input_settings (MetaBackend *backend);
|
MetaInputSettings *meta_backend_get_input_settings (MetaBackend *backend);
|
||||||
|
@ -1598,9 +1598,8 @@ meta_backend_get_capabilities (MetaBackend *backend)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_is_stage_views_scaled (void)
|
meta_backend_is_stage_views_scaled (MetaBackend *backend)
|
||||||
{
|
{
|
||||||
MetaBackend *backend = meta_get_backend ();
|
|
||||||
MetaMonitorManager *monitor_manager =
|
MetaMonitorManager *monitor_manager =
|
||||||
meta_backend_get_monitor_manager (backend);
|
meta_backend_get_monitor_manager (backend);
|
||||||
MetaLogicalMonitorLayoutMode layout_mode;
|
MetaLogicalMonitorLayoutMode layout_mode;
|
||||||
|
@ -3881,6 +3881,7 @@ meta_monitor_manager_post_init (MetaMonitorManager *manager)
|
|||||||
MetaViewportInfo *
|
MetaViewportInfo *
|
||||||
meta_monitor_manager_get_viewports (MetaMonitorManager *manager)
|
meta_monitor_manager_get_viewports (MetaMonitorManager *manager)
|
||||||
{
|
{
|
||||||
|
MetaBackend *backend = meta_monitor_manager_get_backend (manager);
|
||||||
MetaViewportInfo *info;
|
MetaViewportInfo *info;
|
||||||
GArray *views, *scales;
|
GArray *views, *scales;
|
||||||
GList *logical_monitors, *l;
|
GList *logical_monitors, *l;
|
||||||
@ -3906,7 +3907,7 @@ meta_monitor_manager_get_viewports (MetaMonitorManager *manager)
|
|||||||
info = meta_viewport_info_new ((cairo_rectangle_int_t *) views->data,
|
info = meta_viewport_info_new ((cairo_rectangle_int_t *) views->data,
|
||||||
(float *) scales->data,
|
(float *) scales->data,
|
||||||
views->len,
|
views->len,
|
||||||
meta_is_stage_views_scaled ());
|
meta_backend_is_stage_views_scaled (backend));
|
||||||
g_array_unref (views);
|
g_array_unref (views);
|
||||||
g_array_unref (scales);
|
g_array_unref (scales);
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ meta_renderer_real_rebuild_views (MetaRenderer *renderer)
|
|||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
clutter_backend = meta_backend_get_clutter_backend (backend);
|
clutter_backend = meta_backend_get_clutter_backend (backend);
|
||||||
scale = meta_is_stage_views_scaled ()
|
scale = meta_backend_is_stage_views_scaled (backend)
|
||||||
? meta_logical_monitor_get_scale (logical_monitor)
|
? meta_logical_monitor_get_scale (logical_monitor)
|
||||||
: 1.f;
|
: 1.f;
|
||||||
|
|
||||||
|
@ -62,6 +62,18 @@ G_DEFINE_TYPE_WITH_CODE (MetaScreenCastMonitorStreamSrc,
|
|||||||
G_IMPLEMENT_INTERFACE (META_TYPE_HW_CURSOR_INHIBITOR,
|
G_IMPLEMENT_INTERFACE (META_TYPE_HW_CURSOR_INHIBITOR,
|
||||||
hw_cursor_inhibitor_iface_init))
|
hw_cursor_inhibitor_iface_init))
|
||||||
|
|
||||||
|
static MetaBackend *
|
||||||
|
get_backend (MetaScreenCastMonitorStreamSrc *monitor_src)
|
||||||
|
{
|
||||||
|
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
|
||||||
|
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
|
MetaScreenCastSession *session = meta_screen_cast_stream_get_session (stream);
|
||||||
|
MetaScreenCast *screen_cast =
|
||||||
|
meta_screen_cast_session_get_screen_cast (session);
|
||||||
|
|
||||||
|
return meta_screen_cast_get_backend (screen_cast);
|
||||||
|
}
|
||||||
|
|
||||||
static ClutterStage *
|
static ClutterStage *
|
||||||
get_stage (MetaScreenCastMonitorStreamSrc *monitor_src)
|
get_stage (MetaScreenCastMonitorStreamSrc *monitor_src)
|
||||||
{
|
{
|
||||||
@ -98,6 +110,7 @@ meta_screen_cast_monitor_stream_src_get_specs (MetaScreenCastStreamSrc *src,
|
|||||||
{
|
{
|
||||||
MetaScreenCastMonitorStreamSrc *monitor_src =
|
MetaScreenCastMonitorStreamSrc *monitor_src =
|
||||||
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
|
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
|
||||||
|
MetaBackend *backend = get_backend (monitor_src);
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
float scale;
|
float scale;
|
||||||
@ -107,7 +120,7 @@ meta_screen_cast_monitor_stream_src_get_specs (MetaScreenCastStreamSrc *src,
|
|||||||
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
||||||
mode = meta_monitor_get_current_mode (monitor);
|
mode = meta_monitor_get_current_mode (monitor);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
scale = logical_monitor->scale;
|
scale = logical_monitor->scale;
|
||||||
else
|
else
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
@ -175,18 +188,6 @@ before_stage_painted (MetaStage *stage,
|
|||||||
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
|
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetaBackend *
|
|
||||||
get_backend (MetaScreenCastMonitorStreamSrc *monitor_src)
|
|
||||||
{
|
|
||||||
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
|
|
||||||
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
|
||||||
MetaScreenCastSession *session = meta_screen_cast_stream_get_session (stream);
|
|
||||||
MetaScreenCast *screen_cast =
|
|
||||||
meta_screen_cast_session_get_screen_cast (session);
|
|
||||||
|
|
||||||
return meta_screen_cast_get_backend (screen_cast);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
|
is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
|
||||||
{
|
{
|
||||||
@ -508,6 +509,7 @@ meta_screen_cast_monitor_stream_src_record_to_buffer (MetaScreenCastStreamSrc *
|
|||||||
MetaScreenCastMonitorStreamSrc *monitor_src =
|
MetaScreenCastMonitorStreamSrc *monitor_src =
|
||||||
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
|
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
|
||||||
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
|
MetaBackend *backend = get_backend (monitor_src);
|
||||||
ClutterStage *stage;
|
ClutterStage *stage;
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
@ -518,7 +520,7 @@ meta_screen_cast_monitor_stream_src_record_to_buffer (MetaScreenCastStreamSrc *
|
|||||||
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
||||||
stage = get_stage (monitor_src);
|
stage = get_stage (monitor_src);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
scale = meta_logical_monitor_get_scale (logical_monitor);
|
scale = meta_logical_monitor_get_scale (logical_monitor);
|
||||||
else
|
else
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
@ -553,6 +555,7 @@ meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamS
|
|||||||
MetaScreenCastMonitorStreamSrc *monitor_src =
|
MetaScreenCastMonitorStreamSrc *monitor_src =
|
||||||
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
|
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
|
||||||
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
|
||||||
|
MetaBackend *backend = get_backend (monitor_src);
|
||||||
ClutterStage *stage = get_stage (monitor_src);
|
ClutterStage *stage = get_stage (monitor_src);
|
||||||
MetaMonitor *monitor;
|
MetaMonitor *monitor;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
@ -564,7 +567,7 @@ meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamS
|
|||||||
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
logical_monitor = meta_monitor_get_logical_monitor (monitor);
|
||||||
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
|
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
view_scale = meta_logical_monitor_get_scale (logical_monitor);
|
view_scale = meta_logical_monitor_get_scale (logical_monitor);
|
||||||
else
|
else
|
||||||
view_scale = 1.0;
|
view_scale = 1.0;
|
||||||
@ -667,7 +670,7 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
|
|||||||
logical_monitor_rect =
|
logical_monitor_rect =
|
||||||
meta_rectangle_to_graphene_rect (&logical_monitor_layout);
|
meta_rectangle_to_graphene_rect (&logical_monitor_layout);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
view_scale = meta_logical_monitor_get_scale (logical_monitor);
|
view_scale = meta_logical_monitor_get_scale (logical_monitor);
|
||||||
else
|
else
|
||||||
view_scale = 1.0;
|
view_scale = 1.0;
|
||||||
|
@ -198,13 +198,14 @@ meta_screen_cast_monitor_stream_transform_position (MetaScreenCastStream *stream
|
|||||||
{
|
{
|
||||||
MetaScreenCastMonitorStream *monitor_stream =
|
MetaScreenCastMonitorStream *monitor_stream =
|
||||||
META_SCREEN_CAST_MONITOR_STREAM (stream);
|
META_SCREEN_CAST_MONITOR_STREAM (stream);
|
||||||
|
MetaBackend *backend = meta_monitor_get_backend (monitor_stream->monitor);
|
||||||
MetaRectangle logical_monitor_layout;
|
MetaRectangle logical_monitor_layout;
|
||||||
double scale;
|
double scale;
|
||||||
|
|
||||||
logical_monitor_layout =
|
logical_monitor_layout =
|
||||||
meta_logical_monitor_get_layout (monitor_stream->logical_monitor);
|
meta_logical_monitor_get_layout (monitor_stream->logical_monitor);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
scale = meta_logical_monitor_get_scale (monitor_stream->logical_monitor);
|
scale = meta_logical_monitor_get_scale (monitor_stream->logical_monitor);
|
||||||
else
|
else
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "backends/meta-logical-monitor.h"
|
#include "backends/meta-logical-monitor.h"
|
||||||
#include "backends/meta-monitor-manager-private.h"
|
#include "backends/meta-monitor-manager-private.h"
|
||||||
|
#include "backends/meta-screen-cast-session.h"
|
||||||
#include "backends/meta-screen-cast-window.h"
|
#include "backends/meta-screen-cast-window.h"
|
||||||
#include "backends/meta-screen-cast-window-stream-src.h"
|
#include "backends/meta-screen-cast-window-stream-src.h"
|
||||||
#include "compositor/meta-window-actor-private.h"
|
#include "compositor/meta-window-actor-private.h"
|
||||||
@ -211,6 +212,11 @@ meta_screen_cast_window_stream_initable_init (GInitable *initable,
|
|||||||
{
|
{
|
||||||
MetaScreenCastWindowStream *window_stream =
|
MetaScreenCastWindowStream *window_stream =
|
||||||
META_SCREEN_CAST_WINDOW_STREAM (initable);
|
META_SCREEN_CAST_WINDOW_STREAM (initable);
|
||||||
|
MetaScreenCastStream *stream = META_SCREEN_CAST_STREAM (initable);
|
||||||
|
MetaScreenCastSession *session = meta_screen_cast_stream_get_session (stream);
|
||||||
|
MetaScreenCast *screen_cast =
|
||||||
|
meta_screen_cast_session_get_screen_cast (session);
|
||||||
|
MetaBackend *backend = meta_screen_cast_get_backend (screen_cast);
|
||||||
MetaWindow *window = window_stream->window;
|
MetaWindow *window = window_stream->window;
|
||||||
MetaLogicalMonitor *logical_monitor;
|
MetaLogicalMonitor *logical_monitor;
|
||||||
int scale;
|
int scale;
|
||||||
@ -228,7 +234,7 @@ meta_screen_cast_window_stream_initable_init (GInitable *initable,
|
|||||||
G_CALLBACK (on_window_unmanaged),
|
G_CALLBACK (on_window_unmanaged),
|
||||||
window_stream);
|
window_stream);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
scale = (int) ceilf (meta_logical_monitor_get_scale (logical_monitor));
|
scale = (int) ceilf (meta_logical_monitor_get_scale (logical_monitor));
|
||||||
else
|
else
|
||||||
scale = 1;
|
scale = 1;
|
||||||
|
@ -98,7 +98,7 @@ update_ui_scaling_factor (MetaSettings *settings)
|
|||||||
{
|
{
|
||||||
int ui_scaling_factor;
|
int ui_scaling_factor;
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (settings->backend))
|
||||||
ui_scaling_factor = 1;
|
ui_scaling_factor = 1;
|
||||||
else
|
else
|
||||||
ui_scaling_factor = calculate_ui_scaling_factor (settings);
|
ui_scaling_factor = calculate_ui_scaling_factor (settings);
|
||||||
|
@ -373,10 +373,11 @@ assign_cursor_plane (MetaCursorRendererNative *native,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static float
|
static float
|
||||||
calculate_cursor_crtc_sprite_scale (MetaCursorSprite *cursor_sprite,
|
calculate_cursor_crtc_sprite_scale (MetaBackend *backend,
|
||||||
|
MetaCursorSprite *cursor_sprite,
|
||||||
MetaLogicalMonitor *logical_monitor)
|
MetaLogicalMonitor *logical_monitor)
|
||||||
{
|
{
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
{
|
{
|
||||||
return (meta_logical_monitor_get_scale (logical_monitor) *
|
return (meta_logical_monitor_get_scale (logical_monitor) *
|
||||||
meta_cursor_sprite_get_texture_scale (cursor_sprite));
|
meta_cursor_sprite_get_texture_scale (cursor_sprite));
|
||||||
@ -393,6 +394,8 @@ set_crtc_cursor (MetaCursorRendererNative *cursor_renderer_native,
|
|||||||
MetaCrtc *crtc,
|
MetaCrtc *crtc,
|
||||||
MetaCursorSprite *cursor_sprite)
|
MetaCursorSprite *cursor_sprite)
|
||||||
{
|
{
|
||||||
|
MetaCursorRendererNativePrivate *priv =
|
||||||
|
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
|
||||||
MetaCursorRenderer *cursor_renderer =
|
MetaCursorRenderer *cursor_renderer =
|
||||||
META_CURSOR_RENDERER (cursor_renderer_native);
|
META_CURSOR_RENDERER (cursor_renderer_native);
|
||||||
MetaOutput *output = meta_crtc_get_outputs (crtc)->data;
|
MetaOutput *output = meta_crtc_get_outputs (crtc)->data;
|
||||||
@ -438,7 +441,8 @@ set_crtc_cursor (MetaCursorRendererNative *cursor_renderer_native,
|
|||||||
tex_height = cogl_texture_get_height (texture);
|
tex_height = cogl_texture_get_height (texture);
|
||||||
|
|
||||||
cursor_crtc_scale =
|
cursor_crtc_scale =
|
||||||
calculate_cursor_crtc_sprite_scale (cursor_sprite,
|
calculate_cursor_crtc_sprite_scale (priv->backend,
|
||||||
|
cursor_sprite,
|
||||||
logical_monitor);
|
logical_monitor);
|
||||||
|
|
||||||
cursor_rect = (MetaRectangle) {
|
cursor_rect = (MetaRectangle) {
|
||||||
@ -763,7 +767,9 @@ get_common_crtc_sprite_scale_for_logical_monitors (MetaCursorRenderer *renderer,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
tmp_scale =
|
tmp_scale =
|
||||||
calculate_cursor_crtc_sprite_scale (cursor_sprite, logical_monitor);
|
calculate_cursor_crtc_sprite_scale (backend,
|
||||||
|
cursor_sprite,
|
||||||
|
logical_monitor);
|
||||||
|
|
||||||
if (has_visible_crtc_sprite && scale != tmp_scale)
|
if (has_visible_crtc_sprite && scale != tmp_scale)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -1372,7 +1372,7 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
|
|||||||
g_error ("Failed to allocate back buffer texture: %s", error->message);
|
g_error ("Failed to allocate back buffer texture: %s", error->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
scale = meta_logical_monitor_get_scale (logical_monitor);
|
scale = meta_logical_monitor_get_scale (logical_monitor);
|
||||||
else
|
else
|
||||||
scale = 1.0;
|
scale = 1.0;
|
||||||
|
@ -196,7 +196,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer,
|
|||||||
|
|
||||||
view_transform = calculate_view_transform (monitor_manager, logical_monitor);
|
view_transform = calculate_view_transform (monitor_manager, logical_monitor);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
view_scale = logical_monitor->scale;
|
view_scale = logical_monitor->scale;
|
||||||
else
|
else
|
||||||
view_scale = 1.0;
|
view_scale = 1.0;
|
||||||
|
@ -391,6 +391,8 @@ setup_pipeline (MetaBackgroundContent *self,
|
|||||||
ClutterPaintContext *paint_context,
|
ClutterPaintContext *paint_context,
|
||||||
cairo_rectangle_int_t *actor_pixel_rect)
|
cairo_rectangle_int_t *actor_pixel_rect)
|
||||||
{
|
{
|
||||||
|
MetaContext *context = meta_display_get_context (self->display);
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
PipelineFlags pipeline_flags = 0;
|
PipelineFlags pipeline_flags = 0;
|
||||||
guint8 opacity;
|
guint8 opacity;
|
||||||
float color_component;
|
float color_component;
|
||||||
@ -478,7 +480,7 @@ setup_pipeline (MetaBackgroundContent *self,
|
|||||||
float bounds_x1, bounds_x2, bounds_y1, bounds_y2;
|
float bounds_x1, bounds_x2, bounds_y1, bounds_y2;
|
||||||
float clip_radius;
|
float clip_radius;
|
||||||
|
|
||||||
monitor_scale = meta_is_stage_views_scaled ()
|
monitor_scale = meta_backend_is_stage_views_scaled (backend)
|
||||||
? meta_display_get_monitor_scale (self->display, self->monitor)
|
? meta_display_get_monitor_scale (self->display, self->monitor)
|
||||||
: 1.0;
|
: 1.0;
|
||||||
|
|
||||||
@ -566,12 +568,14 @@ static void
|
|||||||
set_glsl_parameters (MetaBackgroundContent *self,
|
set_glsl_parameters (MetaBackgroundContent *self,
|
||||||
cairo_rectangle_int_t *actor_pixel_rect)
|
cairo_rectangle_int_t *actor_pixel_rect)
|
||||||
{
|
{
|
||||||
|
MetaContext *context = meta_display_get_context (self->display);
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
float monitor_scale;
|
float monitor_scale;
|
||||||
float scale[2];
|
float scale[2];
|
||||||
float offset[2];
|
float offset[2];
|
||||||
int pixel_step_uniform_location;
|
int pixel_step_uniform_location;
|
||||||
|
|
||||||
monitor_scale = meta_is_stage_views_scaled ()
|
monitor_scale = meta_backend_is_stage_views_scaled (backend)
|
||||||
? meta_display_get_monitor_scale (self->display, self->monitor)
|
? meta_display_get_monitor_scale (self->display, self->monitor)
|
||||||
: 1.0;
|
: 1.0;
|
||||||
|
|
||||||
|
@ -799,11 +799,13 @@ meta_background_get_texture (MetaBackground *self,
|
|||||||
|
|
||||||
if (monitor->dirty)
|
if (monitor->dirty)
|
||||||
{
|
{
|
||||||
|
MetaContext *context = meta_display_get_context (self->display);
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
GError *catch_error = NULL;
|
GError *catch_error = NULL;
|
||||||
gboolean bare_region_visible = FALSE;
|
gboolean bare_region_visible = FALSE;
|
||||||
int texture_width, texture_height;
|
int texture_width, texture_height;
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
{
|
{
|
||||||
texture_width = monitor_area.width * monitor_scale;
|
texture_width = monitor_area.width * monitor_scale;
|
||||||
texture_height = monitor_area.height * monitor_scale;
|
texture_height = monitor_area.height * monitor_scale;
|
||||||
|
@ -1741,7 +1741,7 @@ root_cursor_prepare_at (MetaCursorSpriteXcursor *sprite_xcursor,
|
|||||||
MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_xcursor);
|
MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_xcursor);
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
{
|
{
|
||||||
if (best_scale != 0.0f)
|
if (best_scale != 0.0f)
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite,
|
|||||||
{
|
{
|
||||||
float texture_scale;
|
float texture_scale;
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
texture_scale = 1.0 / surface->scale;
|
texture_scale = 1.0 / surface->scale;
|
||||||
else
|
else
|
||||||
texture_scale = (meta_logical_monitor_get_scale (logical_monitor) /
|
texture_scale = (meta_logical_monitor_get_scale (logical_monitor) /
|
||||||
|
@ -87,7 +87,13 @@ dnd_surface_find_logical_monitor (MetaWaylandActorSurface *actor_surface)
|
|||||||
static int
|
static int
|
||||||
dnd_subsurface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
|
dnd_subsurface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
|
||||||
{
|
{
|
||||||
if (meta_is_stage_views_scaled ())
|
MetaWaylandSurfaceRole *role = META_WAYLAND_SURFACE_ROLE (actor_surface);
|
||||||
|
MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (role);
|
||||||
|
MetaContext *context =
|
||||||
|
meta_wayland_compositor_get_context (surface->compositor);
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
|
|
||||||
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -256,10 +256,14 @@ meta_wayland_shell_surface_get_geometry_scale (MetaWaylandActorSurface *actor_su
|
|||||||
META_WAYLAND_SURFACE_ROLE (actor_surface);
|
META_WAYLAND_SURFACE_ROLE (actor_surface);
|
||||||
MetaWaylandSurface *surface =
|
MetaWaylandSurface *surface =
|
||||||
meta_wayland_surface_role_get_surface (surface_role);
|
meta_wayland_surface_role_get_surface (surface_role);
|
||||||
|
MetaContext *context =
|
||||||
|
meta_wayland_compositor_get_context (surface->compositor);
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
MetaWindow *toplevel_window;
|
MetaWindow *toplevel_window;
|
||||||
|
|
||||||
toplevel_window = meta_wayland_surface_get_toplevel_window (surface);
|
toplevel_window = meta_wayland_surface_get_toplevel_window (surface);
|
||||||
if (meta_is_stage_views_scaled () || !toplevel_window)
|
if (meta_backend_is_stage_views_scaled (backend) ||
|
||||||
|
!toplevel_window)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return meta_window_wayland_get_geometry_scale (toplevel_window);
|
return meta_window_wayland_get_geometry_scale (toplevel_window);
|
||||||
|
@ -2247,7 +2247,11 @@ meta_wayland_surface_can_scanout_untransformed (MetaWaylandSurface *surface,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (meta_is_stage_views_scaled ())
|
MetaContext *context =
|
||||||
|
meta_wayland_compositor_get_context (surface->compositor);
|
||||||
|
MetaBackend *backend = meta_context_get_backend (context);
|
||||||
|
|
||||||
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
{
|
{
|
||||||
float view_scale;
|
float view_scale;
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ tool_cursor_prepare_at (MetaCursorSpriteXcursor *sprite_xcursor,
|
|||||||
meta_cursor_sprite_xcursor_set_theme_scale (sprite_xcursor,
|
meta_cursor_sprite_xcursor_set_theme_scale (sprite_xcursor,
|
||||||
(int) ceiled_scale);
|
(int) ceiled_scale);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
meta_cursor_sprite_set_texture_scale (cursor_sprite,
|
meta_cursor_sprite_set_texture_scale (cursor_sprite,
|
||||||
1.0 / ceiled_scale);
|
1.0 / ceiled_scale);
|
||||||
else
|
else
|
||||||
|
@ -101,9 +101,11 @@ set_geometry_scale_for_window (MetaWindowWayland *wl_window,
|
|||||||
static int
|
static int
|
||||||
get_window_geometry_scale_for_logical_monitor (MetaLogicalMonitor *logical_monitor)
|
get_window_geometry_scale_for_logical_monitor (MetaLogicalMonitor *logical_monitor)
|
||||||
{
|
{
|
||||||
g_assert (logical_monitor);
|
MetaMonitor *monitor =
|
||||||
|
meta_logical_monitor_get_monitors (logical_monitor)->data;
|
||||||
|
MetaBackend *backend = meta_monitor_get_backend (monitor);
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return meta_logical_monitor_get_scale (logical_monitor);
|
return meta_logical_monitor_get_scale (logical_monitor);
|
||||||
@ -566,7 +568,7 @@ meta_window_wayland_update_main_monitor (MetaWindow *window,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta_is_stage_views_scaled ())
|
if (meta_backend_is_stage_views_scaled (backend))
|
||||||
{
|
{
|
||||||
window->monitor = to;
|
window->monitor = to;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user