mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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
This commit is contained in:
parent
b6f11fa8b8
commit
ed5c3b39ee
@ -1041,6 +1041,17 @@ apply_configuration_with_lid (MetaMonitorConfig *self,
|
||||
return apply_configuration (self, config, manager);
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -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 */
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user