From 872420f460caddc2446a15d30c2426112d34abf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 7 Sep 2022 16:21:25 +0200 Subject: [PATCH] monitor-manager: Make config timeout API non-static While already cleaning up API, if this should ever be more non-static than a constant, it's better if its a function on the monitor manager instance than something static. Part-of: --- src/backends/meta-monitor-manager.c | 9 ++++++--- src/meta/meta-monitor-manager.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c index 5c9a54029..d436fe2b7 100644 --- a/src/backends/meta-monitor-manager.c +++ b/src/backends/meta-monitor-manager.c @@ -1861,8 +1861,8 @@ restore_previous_config (MetaMonitorManager *manager) meta_monitor_manager_ensure_configured (manager); } -gint -meta_monitor_manager_get_display_configuration_timeout (void) +int +meta_monitor_manager_get_display_configuration_timeout (MetaMonitorManager *manager) { return DEFAULT_DISPLAY_CONFIGURATION_TIMEOUT; } @@ -1887,7 +1887,10 @@ cancel_persistent_confirmation (MetaMonitorManager *manager) static void request_persistent_confirmation (MetaMonitorManager *manager) { - manager->persistent_timeout_id = g_timeout_add_seconds (meta_monitor_manager_get_display_configuration_timeout (), + int timeout_s; + + timeout_s = meta_monitor_manager_get_display_configuration_timeout (manager); + manager->persistent_timeout_id = g_timeout_add_seconds (timeout_s, save_config_timeout, manager); g_source_set_name_by_id (manager->persistent_timeout_id, diff --git a/src/meta/meta-monitor-manager.h b/src/meta/meta-monitor-manager.h index ce57156be..c7b05a614 100644 --- a/src/meta/meta-monitor-manager.h +++ b/src/meta/meta-monitor-manager.h @@ -60,7 +60,7 @@ META_EXPORT MetaMonitorSwitchConfigType meta_monitor_manager_get_switch_config (MetaMonitorManager *manager); META_EXPORT -gint meta_monitor_manager_get_display_configuration_timeout (void); +int meta_monitor_manager_get_display_configuration_timeout (MetaMonitorManager *manager); META_EXPORT gboolean meta_monitor_manager_get_panel_orientation_managed (MetaMonitorManager *manager);