[gnome-settings-daemon] media-keys: Port touchpad toggle code to new settings schema
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Port touchpad toggle code to new settings schema
- Date: Mon, 20 Apr 2015 13:39:03 +0000 (UTC)
commit fbbc7df34788edcdd1c6ed2a385202051c1dc341
Author: Rui Matos <tiagomatos gmail com>
Date: Wed Apr 15 18:16:03 2015 +0200
media-keys: Port touchpad toggle code to new settings schema
We forgot to update this on commit
ca754de5039fed6cb96b883dd8e41d8b22ebeea6 .
https://bugzilla.gnome.org/show_bug.cgi?id=747739
plugins/media-keys/gsd-media-keys-manager.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 2c87a5e..69c5f8c 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -40,6 +40,7 @@
#include <gio/gunixfdlist.h>
#include <libupower-glib/upower.h>
+#include <gdesktop-enums.h>
#ifdef HAVE_GUDEV
#include <gudev/gudev.h>
@@ -100,8 +101,8 @@ static const gchar introspection_xml[] =
#define SETTINGS_INTERFACE_DIR "org.gnome.desktop.interface"
#define SETTINGS_POWER_DIR "org.gnome.settings-daemon.plugins.power"
#define SETTINGS_XSETTINGS_DIR "org.gnome.settings-daemon.plugins.xsettings"
-#define SETTINGS_TOUCHPAD_DIR "org.gnome.settings-daemon.peripherals.touchpad"
-#define TOUCHPAD_ENABLED_KEY "touchpad-enabled"
+#define SETTINGS_TOUCHPAD_DIR "org.gnome.desktop.peripherals.touchpad"
+#define TOUCHPAD_ENABLED_KEY "send-events"
#define HIGH_CONTRAST "HighContrast"
#define VOLUME_STEP 6 /* percents for one volume button press */
@@ -939,11 +940,15 @@ do_touchpad_action (GsdMediaKeysManager *manager)
}
settings = g_settings_new (SETTINGS_TOUCHPAD_DIR);
- state = g_settings_get_boolean (settings, TOUCHPAD_ENABLED_KEY);
+ state = (g_settings_get_enum (settings, TOUCHPAD_ENABLED_KEY) ==
+ G_DESKTOP_DEVICE_SEND_EVENTS_ENABLED);
do_touchpad_osd_action (manager, !state);
- g_settings_set_boolean (settings, TOUCHPAD_ENABLED_KEY, !state);
+ g_settings_set_enum (settings, TOUCHPAD_ENABLED_KEY,
+ !state ?
+ G_DESKTOP_DEVICE_SEND_EVENTS_ENABLED :
+ G_DESKTOP_DEVICE_SEND_EVENTS_DISABLED);
g_object_unref (settings);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]