From fc8a4afc450fc1e36723a3c47ed58022dcf4720d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 27 May 2022 20:36:14 +0200 Subject: [PATCH] Remove meta_is_stage_views_enabled() This is an old relic from when ClutterStageView was being added, and tests were somewhat prepared to be able to test the "X11 style" of things, with the nested backend some how managing to emulate that. Lets drop that stuff, it isn't used by the test suite, and isn't useful anyway; if we want to test X11 configurations, we should use the actual X11 backend, which didn't make use of this anyway. Part-of: --- src/backends/meta-backend-private.h | 3 - src/backends/meta-backend.c | 26 -------- src/backends/meta-monitor-manager-dummy.c | 16 +---- src/backends/native/meta-backend-native.c | 7 --- .../x11/nested/meta-backend-x11-nested.c | 7 +-- .../x11/nested/meta-renderer-x11-nested.c | 2 +- .../x11/nested/meta-stage-x11-nested.c | 11 ---- src/tests/meta-monitor-manager-test.c | 32 ++-------- src/tests/monitor-store-unit-tests.c | 18 ------ src/tests/monitor-unit-tests.c | 60 ------------------- 10 files changed, 9 insertions(+), 173 deletions(-) diff --git a/src/backends/meta-backend-private.h b/src/backends/meta-backend-private.h index 6053eb942..64a65c9c7 100644 --- a/src/backends/meta-backend-private.h +++ b/src/backends/meta-backend-private.h @@ -174,9 +174,6 @@ void meta_backend_set_client_pointer_constraint (MetaBackend *backend, void meta_backend_monitors_changed (MetaBackend *backend); -META_EXPORT_TEST -gboolean meta_is_stage_views_enabled (void); - gboolean meta_is_stage_views_scaled (void); MetaInputMapper *meta_backend_get_input_mapper (MetaBackend *backend); diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 5cf09c61d..614d1909c 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -121,8 +121,6 @@ static guint signals[N_SIGNALS]; static MetaBackend *_backend; -static gboolean stage_views_disabled = FALSE; - #define HIDDEN_POINTER_TIMEOUT 300 /* ms */ /** @@ -874,7 +872,6 @@ meta_backend_get_property (GObject *object, static void meta_backend_class_init (MetaBackendClass *klass) { - const gchar *mutter_stage_views; GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->dispose = meta_backend_dispose; @@ -955,9 +952,6 @@ meta_backend_class_init (MetaBackendClass *klass) 0, NULL, NULL, NULL, G_TYPE_NONE, 0); - - mutter_stage_views = g_getenv ("MUTTER_STAGE_VIEWS"); - stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0; } static MetaMonitorManager * @@ -1615,23 +1609,6 @@ meta_backend_get_capabilities (MetaBackend *backend) return META_BACKEND_GET_CLASS (backend)->get_capabilities (backend); } -/** - * meta_is_stage_views_enabled: - * - * Returns whether the #ClutterStage can be rendered using multiple stage views. - * In practice, this means we can define a separate framebuffer for each - * #MetaLogicalMonitor, rather than rendering everything into a single - * framebuffer. For example: in X11, onle one single framebuffer is allowed. - */ -gboolean -meta_is_stage_views_enabled (void) -{ - if (!meta_is_wayland_compositor ()) - return FALSE; - - return !stage_views_disabled; -} - gboolean meta_is_stage_views_scaled (void) { @@ -1640,9 +1617,6 @@ meta_is_stage_views_scaled (void) meta_backend_get_monitor_manager (backend); MetaLogicalMonitorLayoutMode layout_mode; - if (!meta_is_stage_views_enabled ()) - return FALSE; - layout_mode = monitor_manager->layout_mode; return layout_mode == META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL; diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c index 1627bc08e..5ca6a6b73 100644 --- a/src/backends/meta-monitor-manager-dummy.c +++ b/src/backends/meta-monitor-manager-dummy.c @@ -486,10 +486,7 @@ meta_monitor_manager_dummy_ensure_initial_config (MetaMonitorManager *manager) config = meta_monitor_manager_ensure_configured (manager); - if (meta_is_stage_views_enabled ()) - meta_monitor_manager_update_logical_state (manager, config); - else - meta_monitor_manager_update_logical_state_derived (manager, NULL); + meta_monitor_manager_update_logical_state (manager, config); } static void @@ -708,21 +705,12 @@ meta_monitor_manager_dummy_get_max_screen_size (MetaMonitorManager *manager, int *max_width, int *max_height) { - if (meta_is_stage_views_enabled ()) - return FALSE; - - *max_width = 65535; - *max_height = 65535; - - return TRUE; + return FALSE; } static MetaLogicalMonitorLayoutMode meta_monitor_manager_dummy_get_default_layout_mode (MetaMonitorManager *manager) { - if (!meta_is_stage_views_enabled ()) - return META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL; - if (is_monitor_framebuffers_scaled ()) return META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL; else diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index 8900875a0..c8bf097b4 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -764,13 +764,6 @@ meta_backend_native_initable_init (GInitable *initable, MetaBackend *backend = META_BACKEND (native); MetaKmsFlags kms_flags; - if (!meta_is_stage_views_enabled ()) - { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "The native backend requires stage views"); - return FALSE; - } - if (!meta_backend_is_headless (backend)) { const char *session_id = NULL; diff --git a/src/backends/x11/nested/meta-backend-x11-nested.c b/src/backends/x11/nested/meta-backend-x11-nested.c index 0f38f4ad2..9b7f8cc78 100644 --- a/src/backends/x11/nested/meta-backend-x11-nested.c +++ b/src/backends/x11/nested/meta-backend-x11-nested.c @@ -109,11 +109,8 @@ meta_backend_x11_nested_update_screen_size (MetaBackend *backend, ClutterActor *stage = meta_backend_get_stage (backend); MetaRenderer *renderer = meta_backend_get_renderer (backend); - if (meta_is_stage_views_enabled ()) - { - meta_renderer_rebuild_views (renderer); - clutter_stage_clear_stage_views (CLUTTER_STAGE (stage)); - } + meta_renderer_rebuild_views (renderer); + clutter_stage_clear_stage_views (CLUTTER_STAGE (stage)); clutter_actor_set_size (stage, width, height); } diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c b/src/backends/x11/nested/meta-renderer-x11-nested.c index 7c1a4facf..945c4c821 100644 --- a/src/backends/x11/nested/meta-renderer-x11-nested.c +++ b/src/backends/x11/nested/meta-renderer-x11-nested.c @@ -179,7 +179,7 @@ meta_renderer_x11_nested_create_view (MetaRenderer *renderer, MetaOutput *output, MetaCrtc *crtc) { - MetaBackend *backend = meta_get_backend (); + MetaBackend *backend = meta_renderer_get_backend (renderer); MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend); diff --git a/src/backends/x11/nested/meta-stage-x11-nested.c b/src/backends/x11/nested/meta-stage-x11-nested.c index dbf3b7bbf..5e5983882 100644 --- a/src/backends/x11/nested/meta-stage-x11-nested.c +++ b/src/backends/x11/nested/meta-stage-x11-nested.c @@ -63,17 +63,6 @@ meta_stage_x11_nested_resize (ClutterStageWindow *stage_window, gint width, gint height) { - if (!meta_is_stage_views_enabled ()) - { - MetaBackend *backend = meta_get_backend (); - MetaRenderer *renderer = meta_backend_get_renderer (backend); - MetaRendererX11Nested *renderer_x11_nested = - META_RENDERER_X11_NESTED (renderer); - - meta_renderer_x11_nested_ensure_legacy_view (renderer_x11_nested, - width, height); - } - clutter_stage_window_parent_iface->resize (stage_window, width, height); } diff --git a/src/tests/meta-monitor-manager-test.c b/src/tests/meta-monitor-manager-test.c index 55f4100b0..805d930f6 100644 --- a/src/tests/meta-monitor-manager-test.c +++ b/src/tests/meta-monitor-manager-test.c @@ -112,8 +112,6 @@ void meta_monitor_manager_test_set_handles_transforms (MetaMonitorManagerTest *manager_test, gboolean handles_transforms) { - g_assert (handles_transforms || meta_is_stage_views_enabled()); - manager_test->handles_transforms = handles_transforms; } @@ -145,14 +143,7 @@ meta_monitor_manager_test_ensure_initial_config (MetaMonitorManager *manager) config = meta_monitor_manager_ensure_configured (manager); - if (meta_is_stage_views_enabled ()) - { - meta_monitor_manager_update_logical_state (manager, config); - } - else - { - meta_monitor_manager_update_logical_state_derived (manager, NULL); - } + meta_monitor_manager_update_logical_state (manager, config); } static void @@ -261,10 +252,7 @@ meta_monitor_manager_test_apply_monitors_config (MetaMonitorManager *manage manager->screen_width = META_MONITOR_MANAGER_MIN_SCREEN_WIDTH; manager->screen_height = META_MONITOR_MANAGER_MIN_SCREEN_HEIGHT; - if (meta_is_stage_views_enabled ()) - meta_monitor_manager_rebuild (manager, NULL); - else - meta_monitor_manager_rebuild_derived (manager, config); + meta_monitor_manager_rebuild (manager, NULL); return TRUE; } @@ -293,10 +281,7 @@ meta_monitor_manager_test_apply_monitors_config (MetaMonitorManager *manage update_screen_size (manager, config); - if (meta_is_stage_views_enabled ()) - meta_monitor_manager_rebuild (manager, config); - else - meta_monitor_manager_rebuild_derived (manager, config); + meta_monitor_manager_rebuild (manager, config); return TRUE; } @@ -399,21 +384,12 @@ meta_monitor_manager_test_get_max_screen_size (MetaMonitorManager *manager, int *max_width, int *max_height) { - if (meta_is_stage_views_enabled ()) - return FALSE; - - *max_width = 65535; - *max_height = 65535; - - return TRUE; + return FALSE; } static MetaLogicalMonitorLayoutMode meta_monitor_manager_test_get_default_layout_mode (MetaMonitorManager *manager) { - if (!meta_is_stage_views_enabled ()) - return META_LOGICAL_MONITOR_LAYOUT_MODE_PHYSICAL; - if (is_monitor_framebuffer_scaled ()) return META_LOGICAL_MONITOR_LAYOUT_MODE_LOGICAL; else diff --git a/src/tests/monitor-store-unit-tests.c b/src/tests/monitor-store-unit-tests.c index 18622f20c..930d1ab79 100644 --- a/src/tests/monitor-store-unit-tests.c +++ b/src/tests/monitor-store-unit-tests.c @@ -537,12 +537,6 @@ meta_test_monitor_store_scale (void) .n_configurations = 1 }; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - meta_set_custom_monitor_config (test_context, "scale.xml"); check_monitor_store_configurations (&expect); @@ -587,12 +581,6 @@ meta_test_monitor_store_fractional_scale (void) .n_configurations = 1 }; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - meta_set_custom_monitor_config (test_context, "fractional-scale.xml"); check_monitor_store_configurations (&expect); @@ -637,12 +625,6 @@ meta_test_monitor_store_high_precision_fractional_scale (void) .n_configurations = 1 }; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - meta_set_custom_monitor_config (test_context, "high-precision-fractional-scale.xml"); check_monitor_store_configurations (&expect); diff --git a/src/tests/monitor-unit-tests.c b/src/tests/monitor-unit-tests.c index b9454f28b..56a017bfa 100644 --- a/src/tests/monitor-unit-tests.c +++ b/src/tests/monitor-unit-tests.c @@ -1533,12 +1533,6 @@ meta_test_monitor_hidpi_linear_config (void) }; MetaMonitorTestSetup *test_setup; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NO_STORED); @@ -3094,12 +3088,6 @@ meta_test_monitor_lid_scaled_closed_opened (void) MetaMonitorManager *monitor_manager = meta_backend_get_monitor_manager (backend); - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NONE); @@ -4523,12 +4511,6 @@ meta_test_monitor_orientation_initial_stored_rotated (void) MetaOrientation orientation; unsigned int times_signalled = 0; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - g_test_message ("%s", G_STRFUNC); orientation_mock = meta_sensors_proxy_mock_get (); touch_device = meta_test_add_touch_device (backend); @@ -4683,12 +4665,6 @@ meta_test_monitor_orientation_initial_stored_rotated_no_touch (void) MetaOrientation orientation; unsigned int times_signalled = 0; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - g_test_message ("%s", G_STRFUNC); orientation_mock = meta_sensors_proxy_mock_get (); orientation = META_ORIENTATION_RIGHT_UP; @@ -5960,12 +5936,6 @@ meta_test_monitor_custom_scale_config (void) }; MetaMonitorTestSetup *test_setup; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NONE); @@ -6062,12 +6032,6 @@ meta_test_monitor_custom_fractional_scale_config (void) }; MetaMonitorTestSetup *test_setup; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NONE); @@ -6164,12 +6128,6 @@ meta_test_monitor_custom_high_precision_fractional_scale_config (void) }; MetaMonitorTestSetup *test_setup; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NONE); @@ -6308,12 +6266,6 @@ meta_test_monitor_custom_tiled_config (void) }; MetaMonitorTestSetup *test_setup; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NONE); @@ -6471,12 +6423,6 @@ meta_test_monitor_custom_tiled_custom_resolution_config (void) }; MetaMonitorTestSetup *test_setup; - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - test_setup = meta_create_monitor_test_setup (test_backend, &test_case.setup, MONITOR_TEST_FLAG_NONE); @@ -7621,12 +7567,6 @@ meta_test_monitor_custom_second_rotated_nonnative_config (void) MetaMonitorManagerTest *monitor_manager_test = META_MONITOR_MANAGER_TEST (monitor_manager); - if (!meta_is_stage_views_enabled ()) - { - g_test_skip ("Not using stage views"); - return; - } - meta_monitor_manager_test_set_handles_transforms (monitor_manager_test, FALSE);