[mutter] monitor-manager: Clean up hot-plug paths slightly
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager: Clean up hot-plug paths slightly
- Date: Thu, 28 Jan 2021 20:26:33 +0000 (UTC)
commit 432682f3054f58cfc50669d06b8da89486f4c1e4
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Jan 25 21:10:53 2021 +0100
monitor-manager: Clean up hot-plug paths slightly
Make the API used more shared and better named.
meta_monitor_manager_on_hotplug() was renamed
meta_monitor_manager_reconfigure(), and meta_monitor_manager_reload()
was introduced to combine reading the current state and reconfiguring.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
src/backends/meta-monitor-manager-private.h | 5 +++--
src/backends/meta-monitor-manager.c | 11 +++++++++--
src/backends/native/meta-monitor-manager-kms.c | 3 +--
src/backends/x11/meta-monitor-manager-xrandr.c | 2 +-
src/tests/meta-monitor-manager-test.c | 3 +--
5 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h
index b0ffd36d6b..70d61f823b 100644
--- a/src/backends/meta-monitor-manager-private.h
+++ b/src/backends/meta-monitor-manager-private.h
@@ -325,11 +325,12 @@ void meta_monitor_manager_confirm_configuration (MetaMonitorManag
gboolean meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager);
-META_EXPORT_TEST
void meta_monitor_manager_read_current_state (MetaMonitorManager *manager);
+void meta_monitor_manager_reconfigure (MetaMonitorManager *manager);
+
META_EXPORT_TEST
-void meta_monitor_manager_on_hotplug (MetaMonitorManager *manager);
+void meta_monitor_manager_reload (MetaMonitorManager *manager);
gboolean meta_monitor_manager_get_monitor_matrix (MetaMonitorManager *manager,
MetaMonitor *monitor,
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 756c0e64cb..0fbdf56619 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -809,7 +809,7 @@ experimental_features_changed (MetaSettings *settings,
should_reconfigure = TRUE;
if (should_reconfigure)
- meta_monitor_manager_on_hotplug (manager);
+ meta_monitor_manager_reconfigure (manager);
meta_settings_update_ui_scaling_factor (settings);
}
@@ -3098,11 +3098,18 @@ meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager,
}
void
-meta_monitor_manager_on_hotplug (MetaMonitorManager *manager)
+meta_monitor_manager_reconfigure (MetaMonitorManager *manager)
{
meta_monitor_manager_ensure_configured (manager);
}
+void
+meta_monitor_manager_reload (MetaMonitorManager *manager)
+{
+ meta_monitor_manager_read_current_state (manager);
+ meta_monitor_manager_reconfigure (manager);
+}
+
static gboolean
calculate_viewport_matrix (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c
index 3d2037c952..cabaa3201c 100644
--- a/src/backends/native/meta-monitor-manager-kms.c
+++ b/src/backends/native/meta-monitor-manager-kms.c
@@ -463,8 +463,7 @@ meta_monitor_manager_kms_set_crtc_gamma (MetaMonitorManager *manager,
static void
handle_hotplug_event (MetaMonitorManager *manager)
{
- meta_monitor_manager_read_current_state (manager);
- meta_monitor_manager_on_hotplug (manager);
+ meta_monitor_manager_reload (manager);
}
static void
diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c
index a2f8931625..31eac6fb18 100644
--- a/src/backends/x11/meta-monitor-manager-xrandr.c
+++ b/src/backends/x11/meta-monitor-manager-xrandr.c
@@ -1126,7 +1126,7 @@ meta_monitor_manager_xrandr_handle_xevent (MetaMonitorManagerXrandr *manager_xra
manager_xrandr->last_xrandr_set_timestamp);
if (is_hotplug)
{
- meta_monitor_manager_on_hotplug (manager);
+ meta_monitor_manager_reconfigure (manager);
}
else
{
diff --git a/src/tests/meta-monitor-manager-test.c b/src/tests/meta-monitor-manager-test.c
index 369dc700b3..5a672c58f9 100644
--- a/src/tests/meta-monitor-manager-test.c
+++ b/src/tests/meta-monitor-manager-test.c
@@ -63,8 +63,7 @@ meta_monitor_manager_test_emulate_hotplug (MetaMonitorManagerTest *manager_test,
old_test_setup = manager_test->test_setup;
manager_test->test_setup = test_setup;
- meta_monitor_manager_read_current_state (manager);
- meta_monitor_manager_on_hotplug (manager);
+ meta_monitor_manager_reload (manager);
g_free (old_test_setup);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]