[gnome-settings-daemon] media-keys: Show a touchpad-disabled if no touchpad



commit ab4ac947c66c232afcb874ac36bece6e652ed3cc
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Oct 27 12:53:45 2010 +0100

    media-keys: Show a touchpad-disabled if no touchpad
    
    When pressing the touchpad button on the keyboard, and
    there's no touchpad present, don't show a wrong state
    for the touchpad status, but always show a "touch disabled"
    popup.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=614213

 plugins/media-keys/gsd-media-keys-manager.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index bb7ac7a..a20767a 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -49,6 +49,7 @@
 #include "eggaccelerators.h"
 #include "acme.h"
 #include "gsd-media-keys-window.h"
+#include "gsd-input-helper.h"
 
 #ifdef HAVE_PULSE
 #include <canberra-gtk.h>
@@ -553,6 +554,13 @@ do_touchpad_action (GsdMediaKeysManager *manager)
         GSettings *settings;
         gboolean state;
 
+        if (touchpad_is_present () == FALSE) {
+                dialog_init (manager);
+                gsd_media_keys_window_set_action_custom (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
+                                                         "touchpad-disabled", FALSE);
+                return;
+        }
+
         settings = g_settings_new ("org.gnome.settings-daemon.peripherals.touchpad");
         state = g_settings_get_boolean (settings, TOUCHPAD_ENABLED_KEY);
 



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