[gnome-settings-daemon] Add settings key for disabling boot time configuration



commit 2ef2dfe21d6b8a6befc622a7991cf1e64e67c847
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Fri Nov 5 10:38:40 2010 +0100

    Add settings key for disabling boot time configuration
    
    In a lot of situations it is undesirable to have g-s-d change the XRandR
    settings, because it overrides X.org customizations, leads to unnecessary mode
    switches, or increases boot time. Add a key "use-xorg-monitor-settings" to
    disable apply_default_boot_configuration(), in which case the XRandR
    configuration will not be touched unless there is a global or per-user
    configuration file.
    
    Ported initial patch from Martin Pitt to GSettings
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=631388

 data/gnome-settings-daemon.convert                 |    1 +
 ...ettings-daemon.plugins.xrandr.gschema.xml.in.in |    5 +++++
 plugins/xrandr/gsd-xrandr-manager.c                |   10 ++++++----
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/data/gnome-settings-daemon.convert b/data/gnome-settings-daemon.convert
index 3665575..9469fdf 100644
--- a/data/gnome-settings-daemon.convert
+++ b/data/gnome-settings-daemon.convert
@@ -95,6 +95,7 @@ default-configuration-file = /apps/gnome_settings_daemon/xrandr/default_configur
 priority = /apps/gnome_settings_daemon/plugins/xrandr/priority
 turn-on-external-monitors = /apps/gnome_settings_daemon/xrandr/turn_on_external_monitors_at_startup
 turn-on-laptop-monitor = /apps/gnome_settings_daemon/xrandr/turn_on_laptop_monitor_at_startup
+use-xorg-monitor-settings = /apps/gnome_settings_daemon/xrandr/use_xorg_monitor_settings
 
 [org.gnome.settings-daemon.plugins.xrdb]
 active = /apps/gnome_settings_daemon/plugins/xrdb/active
diff --git a/data/org.gnome.settings-daemon.plugins.xrandr.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.xrandr.gschema.xml.in.in
index 1c013a4..994e3ea 100644
--- a/data/org.gnome.settings-daemon.plugins.xrandr.gschema.xml.in.in
+++ b/data/org.gnome.settings-daemon.plugins.xrandr.gschema.xml.in.in
@@ -25,5 +25,10 @@
       <_summary>Turn on laptop monitor after system boot</_summary>
       <_description>Turn on laptop monitor after system boot if user plugs in external monitor on system boot.</_description>
     </key>
+    <key name="use-xorg-monitor-settings" type="b">
+      <default>false</default>
+      <_summary>Do not touch monitor configuration</_summary>
+      <_description>Usually, gnome-settings-daemon configures internal and external monitors according to the turn_on_external_monitors_at_startup and turn_on_laptop_monitor_at_startup settings and determines an appropriate cloning/side-by-side mode. Setting this key to True disables this, and the monitor settings are not touched at all (unless there is an explicit user configuration).</_description>
+    </key>
   </schema>
 </schemalist>
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index b0c4cc8..fec9c16 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -56,9 +56,10 @@
 #define GSD_XRANDR_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_XRANDR_MANAGER, GsdXrandrManagerPrivate))
 
 #define CONF_DIR "org.gnome.settings-daemon.plugins.xrandr"
-#define CONF_KEY_TURN_ON_EXTERNAL_MONITORS_AT_STARTUP   ("turn-on-external-monitors")
-#define CONF_KEY_TURN_ON_LAPTOP_MONITOR_AT_STARTUP      ("turn-on-laptop-monitor")
-#define CONF_KEY_DEFAULT_CONFIGURATION_FILE             ("default-configuration-file")
+#define CONF_KEY_TURN_ON_EXTERNAL_MONITORS_AT_STARTUP   "turn-on-external-monitors"
+#define CONF_KEY_TURN_ON_LAPTOP_MONITOR_AT_STARTUP      "turn-on-laptop-monitor"
+#define CONF_KEY_DEFAULT_CONFIGURATION_FILE             "default-configuration-file"
+#define CONF_KEY_USE_XORG_MONITOR_SETTINGS              "use-xorg-monitor-settings"
 
 #define VIDEO_KEYSYM    "XF86Display"
 #define ROTATE_KEYSYM   "XF86RotateWindows"
@@ -1767,7 +1768,8 @@ gsd_xrandr_manager_start (GsdXrandrManager *manager,
         show_timestamps_dialog (manager, "Startup");
         if (!apply_stored_configuration_at_startup (manager, GDK_CURRENT_TIME)) /* we don't have a real timestamp at startup anyway */
                 if (!apply_default_configuration_from_file (manager, GDK_CURRENT_TIME))
-                        apply_default_boot_configuration (manager, GDK_CURRENT_TIME);
+                        if (!g_settings_get_boolean (manager->priv->settings, CONF_KEY_USE_XORG_MONITOR_SETTINGS))
+                                apply_default_boot_configuration (manager, GDK_CURRENT_TIME);
 
         log_msg ("State of screen after initial configuration:\n");
         log_screen (manager->priv->rw_screen);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]