[mutter] monitor-manager: Add get_is_builtin_display_on()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] monitor-manager: Add get_is_builtin_display_on()
- Date: Fri, 22 Apr 2016 14:31:02 +0000 (UTC)
commit ed5c3b39ee285d25ebe1a5e62cea46b6cdedd59c
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Apr 20 20:00:45 2016 +0200
monitor-manager: Add get_is_builtin_display_on()
Wrap the existing laptop_display_is_on() method in a public function
that gnome-shell can use to query whether a builtin output is present
and enabled.
https://bugzilla.gnome.org/show_bug.cgi?id=765267
src/backends/meta-monitor-config.c | 11 +++++++++++
src/backends/meta-monitor-config.h | 2 ++
src/backends/meta-monitor-manager.c | 8 ++++++++
src/meta/meta-monitor-manager.h | 2 ++
4 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor-config.c b/src/backends/meta-monitor-config.c
index 1361dd6..727b033 100644
--- a/src/backends/meta-monitor-config.c
+++ b/src/backends/meta-monitor-config.c
@@ -1042,6 +1042,17 @@ apply_configuration_with_lid (MetaMonitorConfig *self,
}
gboolean
+meta_monitor_config_get_is_builtin_display_on (MetaMonitorConfig *self)
+{
+ g_return_val_if_fail (META_IS_MONITOR_CONFIG (self), FALSE);
+
+ if (self->current)
+ return laptop_display_is_on (self->current);
+
+ return FALSE;
+}
+
+gboolean
meta_monitor_config_apply_stored (MetaMonitorConfig *self,
MetaMonitorManager *manager)
{
diff --git a/src/backends/meta-monitor-config.h b/src/backends/meta-monitor-config.h
index 10b95d2..f617649 100644
--- a/src/backends/meta-monitor-config.h
+++ b/src/backends/meta-monitor-config.h
@@ -49,4 +49,6 @@ void meta_monitor_config_make_persistent (MetaMonitorConfig *confi
void meta_monitor_config_restore_previous (MetaMonitorConfig *config,
MetaMonitorManager *manager);
+gboolean meta_monitor_config_get_is_builtin_display_on (MetaMonitorConfig *config);
+
#endif /* META_MONITOR_CONFIG_H */
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 31d0d49..93588e3 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -1599,3 +1599,11 @@ meta_monitor_manager_get_monitor_at_point (MetaMonitorManager *manager,
return -1;
}
+
+gboolean
+meta_monitor_manager_get_is_builtin_display_on (MetaMonitorManager *manager)
+{
+ g_return_val_if_fail (META_IS_MONITOR_MANAGER (manager), FALSE);
+
+ return meta_monitor_config_get_is_builtin_display_on (manager->config);
+}
diff --git a/src/meta/meta-monitor-manager.h b/src/meta/meta-monitor-manager.h
index 5a6604c..68b5451 100644
--- a/src/meta/meta-monitor-manager.h
+++ b/src/meta/meta-monitor-manager.h
@@ -34,4 +34,6 @@ MetaMonitorManager *meta_monitor_manager_get (void);
gint meta_monitor_manager_get_monitor_for_output (MetaMonitorManager *manager,
guint id);
+gboolean meta_monitor_manager_get_is_builtin_display_on (MetaMonitorManager *manager);
+
#endif /* META_MONITOR_MANAGER_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]