From 4c1220836331b9442a54ff0ec9dfa5ab55ed91e3 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Thu, 15 Oct 2020 12:21:05 +0200 Subject: [PATCH] monitor-manager: Add a handle_orientation_change helper function Move the bulk of orientation_changed to a new handle_orientation_change helper function. This is a preparation patch for further orientation handling related changes. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1506 --- src/backends/meta-monitor-manager.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 1c6d37c30..18aeddcd9 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -678,16 +678,13 @@ done: } static void -orientation_changed (MetaOrientationManager *orientation_manager, - MetaMonitorManager *manager) +handle_orientation_change (MetaOrientationManager *orientation_manager, + MetaMonitorManager *manager) { MetaMonitorTransform transform; GError *error = NULL; MetaMonitorsConfig *config; - if (!manager->panel_orientation_managed) - return; - switch (meta_orientation_manager_get_orientation (orientation_manager)) { case META_ORIENTATION_NORMAL: @@ -726,6 +723,16 @@ orientation_changed (MetaOrientationManager *orientation_manager, g_object_unref (config); } +static void +orientation_changed (MetaOrientationManager *orientation_manager, + MetaMonitorManager *manager) +{ + if (!manager->panel_orientation_managed) + return; + + handle_orientation_change (orientation_manager, manager); +} + static void experimental_features_changed (MetaSettings *settings, MetaExperimentalFeature old_experimental_features,