[gnome-flashback] monitors-config: use match rule to check laptop panel visibility
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] monitors-config: use match rule to check laptop panel visibility
- Date: Sat, 23 Oct 2021 18:48:45 +0000 (UTC)
commit 5e8dd79505c23e34c1d1919b6b362efee7eefb27
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Tue Sep 14 00:05:44 2021 +0300
monitors-config: use match rule to check laptop panel visibility
Based on mutter commit:
https://gitlab.gnome.org/GNOME/mutter/-/commit/37e154c832de
backends/gf-monitor-config-manager.c | 7 +++++++
backends/gf-monitor-manager-private.h | 3 +++
backends/gf-monitors-config.c | 13 +------------
3 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/backends/gf-monitor-config-manager.c b/backends/gf-monitor-config-manager.c
index f047dbd..6e1ffb3 100644
--- a/backends/gf-monitor-config-manager.c
+++ b/backends/gf-monitor-config-manager.c
@@ -1505,3 +1505,10 @@ gf_monitor_config_manager_save_current (GfMonitorConfigManager *config_manager)
gf_monitor_config_store_add (config_manager->config_store,
config_manager->current_config);
}
+
+gboolean
+gf_monitor_manager_is_monitor_visible (GfMonitorManager *monitor_manager,
+ GfMonitor *monitor)
+{
+ return monitor_matches_rule (monitor, monitor_manager, MONITOR_MATCH_VISIBLE);
+}
diff --git a/backends/gf-monitor-manager-private.h b/backends/gf-monitor-manager-private.h
index e36f5b6..0fc1a3a 100644
--- a/backends/gf-monitor-manager-private.h
+++ b/backends/gf-monitor-manager-private.h
@@ -222,6 +222,9 @@ GfPowerSave gf_monitor_manager_get_power_save_mode (GfM
void gf_monitor_manager_power_save_mode_changed (GfMonitorManager
*manager,
GfPowerSave
mode);
+gboolean gf_monitor_manager_is_monitor_visible (GfMonitorManager
*manager,
+ GfMonitor
*monitor);
+
G_END_DECLS
#endif
diff --git a/backends/gf-monitors-config.c b/backends/gf-monitors-config.c
index 21f736e..aac41d6 100644
--- a/backends/gf-monitors-config.c
+++ b/backends/gf-monitors-config.c
@@ -28,16 +28,6 @@
G_DEFINE_TYPE (GfMonitorsConfig, gf_monitors_config, G_TYPE_OBJECT)
-static gboolean
-is_lid_closed (GfMonitorManager *monitor_manager)
-{
- GfBackend *backend;
-
- backend = gf_monitor_manager_get_backend (monitor_manager);
-
- return gf_backend_is_lid_closed (backend);
-}
-
static gboolean
has_adjacent_neighbour (GfMonitorsConfig *config,
GfLogicalMonitorConfig *logical_monitor_config)
@@ -182,8 +172,7 @@ gf_monitors_config_new (GfMonitorManager *monitor_manager,
GfMonitor *monitor = l->data;
GfMonitorSpec *monitor_spec;
- if (is_lid_closed (monitor_manager) &&
- gf_monitor_is_laptop_panel (monitor))
+ if (!gf_monitor_manager_is_monitor_visible (monitor_manager, monitor))
continue;
monitor_spec = gf_monitor_get_spec (monitor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]