[mutter] meta-monitor-manager: Add API to rotate the current configuration
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] meta-monitor-manager: Add API to rotate the current configuration
- Date: Fri, 14 Jul 2017 14:47:35 +0000 (UTC)
commit 7360f51ee82f9202829b8b85807a9b2692308e8d
Author: Rui Matos <tiagomatos gmail com>
Date: Thu May 4 14:25:47 2017 +0200
meta-monitor-manager: Add API to rotate the current configuration
This will allows us to support the XF86RotateWindows key present on
some laptops directly in mutter.
https://bugzilla.gnome.org/show_bug.cgi?id=781906
src/backends/meta-monitor-manager-private.h | 2 +
src/backends/meta-monitor-manager.c | 29 +++++++++++++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager-private.h b/src/backends/meta-monitor-manager-private.h
index fa6c9c5..9fed7cf 100644
--- a/src/backends/meta-monitor-manager-private.h
+++ b/src/backends/meta-monitor-manager-private.h
@@ -554,6 +554,8 @@ gboolean meta_monitor_manager_get_max_screen_size (MetaMonitorManager
MetaLogicalMonitorLayoutMode
meta_monitor_manager_get_default_layout_mode (MetaMonitorManager *manager);
+void meta_monitor_manager_rotate_monitor (MetaMonitorManager *manager);
+
void meta_monitor_manager_clear_output (MetaOutput *output);
void meta_monitor_manager_clear_mode (MetaCrtcMode *mode);
void meta_monitor_manager_clear_crtc (MetaCrtc *crtc);
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index ed07884..166d9a3 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -3255,3 +3255,32 @@ meta_monitor_manager_get_is_builtin_display_on (MetaMonitorManager *manager)
return meta_monitor_is_active (laptop_panel);
}
+
+void
+meta_monitor_manager_rotate_monitor (MetaMonitorManager *manager)
+{
+ if (!meta_is_monitor_config_manager_enabled ())
+ {
+ meta_monitor_config_rotate_monitor (manager->legacy_config);
+ }
+ else
+ {
+ GError *error = NULL;
+ MetaMonitorsConfig *config =
+ meta_monitor_config_manager_create_for_rotate_monitor (manager->config_manager);
+
+ if (!config)
+ return;
+
+ if (!meta_monitor_manager_apply_monitors_config (manager,
+ config,
+ META_MONITORS_CONFIG_METHOD_TEMPORARY,
+ &error))
+ {
+ g_warning ("Failed to use rotate monitor configuration: %s",
+ error->message);
+ g_error_free (error);
+ }
+ g_object_unref (config);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]