[gnome-settings-daemon/randr-osd: 11/15] Add GConf keys for to customize the XF86Display and XF86RotateWindows hotkeys



commit 40925dbf8777fff4600fdc8bdfbfed3294db5a95
Author: Federico Mena Quintero <federico novell com>
Date:   Tue Jan 19 12:26:43 2010 -0600

    Add GConf keys for to customize the XF86Display and XF86RotateWindows hotkeys
    
    Normally having those keysyms hardcoded is fine if X is configured to
    emit them when the user presses the corresponding keys on laptops.
    However, for testing purposes on desktop PCs which don't have those
    hotkeys, it is useful to configure different hotkeys temporarily.
    The keys can of course be changed as well on badly-configured laptops,
    but this should be better fixed at the kernel and X level if possible.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 data/apps_gnome_settings_daemon_xrandr.schemas.in |   34 +++++++++++++++++++++
 plugins/xrandr/gsd-xrandr-manager.c               |    6 ++-
 2 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/data/apps_gnome_settings_daemon_xrandr.schemas.in b/data/apps_gnome_settings_daemon_xrandr.schemas.in
index c9f59fd..2d7d13d 100644
--- a/data/apps_gnome_settings_daemon_xrandr.schemas.in
+++ b/data/apps_gnome_settings_daemon_xrandr.schemas.in
@@ -14,5 +14,39 @@
 		</long>
             </locale>
         </schema>
+
+	<schema>
+	    <key>/schemas/apps/gnome_settings_daemon/xrandr/switch_monitors_key</key>
+	    <applyto>/apps/gnome_settings_daemon/xrandr/switch_monitors_key</applyto>
+            <owner>gnome</owner>
+	    <type>string</type>
+            <default>XF86Display</default>
+            <locale name="C">
+	        <short>Key to use to switch the monitor configuration</short>
+                <long>Most laptops have a hotkey that you can press to
+                switch the display among the internal or external
+                monitor.  This GConf key should normally be set to
+                'XF86Display' as X will have that key preconfigured,
+                but you can change it to something else if you wish.
+		</long>
+            </locale>
+        </schema>
+
+	<schema>
+	    <key>/schemas/apps/gnome_settings_daemon/xrandr/rotate_display_key</key>
+	    <applyto>/apps/gnome_settings_daemon/xrandr/rotate_display_key</applyto>
+            <owner>gnome</owner>
+	    <type>string</type>
+            <default>XF86RotateWindows</default>
+            <locale name="C">
+	        <short>Key to use to rotate the monitor's display</short>
+                <long>Some tablet PCs have a hotkey that you can press
+                to rotate the display from portrait to landscape
+                orientation.  This GConf key should normally be set to
+                'XF86RotateWindows' as X will have that key preconfigured,
+                but you can change it to something else if you wish.
+		</long>
+            </locale>
+        </schema>
     </schemalist>
 </gconfschemafile>
diff --git a/plugins/xrandr/gsd-xrandr-manager.c b/plugins/xrandr/gsd-xrandr-manager.c
index b2e769f..0200a5f 100644
--- a/plugins/xrandr/gsd-xrandr-manager.c
+++ b/plugins/xrandr/gsd-xrandr-manager.c
@@ -65,7 +65,9 @@
 #define GSD_XRANDR_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_XRANDR_MANAGER, GsdXrandrManagerPrivate))
 
 #define CONF_DIR "/apps/gnome_settings_daemon/xrandr"
-#define SHOW_NOTIFICATION_ICON_KEY "show_notification_icon"
+#define SHOW_NOTIFICATION_ICON_KEY (CONF_DIR "/show_notification_icon") /* Whether to show the tray icon to let the user switch monitor configurations */
+#define SWITCH_MONITORS_KEY        (CONF_DIR "/switch_monitors_key")    /* Normally XF86Display (Fn-F7 on Thinkpads, Fn-F4 on HPs, etc.) */
+#define ROTATE_DISPLAY_KEY         (CONF_DIR "/rotate_display_key")     /* Normally XF86RotateWindows (special hotkey on pressure-sensitive tablets) */
 
 #define VIDEO_KEYSYM    "XF86Display"
 #define ROTATE_KEYSYM   "XF86RotateWindows"
@@ -2234,7 +2236,7 @@ status_icon_stop (GsdXrandrManager *manager)
 static void
 start_or_stop_icon (GsdXrandrManager *manager)
 {
-        if (gconf_client_get_bool (manager->priv->client, CONF_DIR "/" SHOW_NOTIFICATION_ICON_KEY, NULL)) {
+        if (gconf_client_get_bool (manager->priv->client, SHOW_NOTIFICATION_ICON_KEY, NULL)) {
                 status_icon_start (manager);
         }
         else {



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