[gnome-settings-daemon] mouse: Port for GSettings changes
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] mouse: Port for GSettings changes
- Date: Fri, 8 Oct 2010 14:44:41 +0000 (UTC)
commit 762863138f9019e81d5df02bb8fce51bc7be55f3
Author: Bastien Nocera <hadess hadess net>
Date: Fri Oct 8 15:44:16 2010 +0100
mouse: Port for GSettings changes
plugins/mouse/Makefile.am | 1 +
plugins/mouse/gsd-mouse-manager.c | 14 +++++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/plugins/mouse/Makefile.am b/plugins/mouse/Makefile.am
index 814c21a..832d00e 100644
--- a/plugins/mouse/Makefile.am
+++ b/plugins/mouse/Makefile.am
@@ -8,6 +8,7 @@ libmouse_la_SOURCES = \
libmouse_la_CPPFLAGS = \
-I$(top_srcdir)/gnome-settings-daemon \
+ -I$(top_srcdir)/data/ \
-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
$(AM_CPPFLAGS)
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index 904c498..8943d14 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -50,6 +50,7 @@
#include "gnome-settings-profile.h"
#include "gsd-mouse-manager.h"
+#include "gsd-enums.h"
#define GSD_MOUSE_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_MOUSE_MANAGER, GsdMouseManagerPrivate))
@@ -66,7 +67,7 @@
#define KEY_TOUCHPAD_DISABLE_W_TYPING "disable_while_typing"
#ifdef HAVE_X11_EXTENSIONS_XINPUT_H
#define KEY_TAP_TO_CLICK "tap_to_click"
-#define KEY_SCROLL_METHOD "scroll_method"
+#define KEY_SCROLL_METHOD "scroll-method"
#define KEY_PAD_HORIZ_SCROLL "horiz_scroll_enabled"
#define KEY_TOUCHPAD_ENABLED "touchpad_enabled"
#endif
@@ -706,7 +707,7 @@ set_horiz_scroll (gboolean state)
* scrolling
*/
static int
-set_edge_scroll (int method)
+set_edge_scroll (GsdTouchpadScrollMethod method)
{
int numdevices, i, rc;
XDeviceInfo *devicelist = XListInputDevices (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), &numdevices);
@@ -734,7 +735,7 @@ set_edge_scroll (int method)
&bytes_after, &data);
if (rc == Success && act_type == XA_INTEGER &&
act_format == 8 && nitems >= 2) {
- data[0] = (method == 1) ? 1 : 0;
+ data[0] = (method == GSD_TOUCHPAD_SCROLL_METHOD_EDGE_SCROLLING) ? 1 : 0;
XChangeDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device,
prop_edge, XA_INTEGER, 8,
PropModeReplace, data, nitems);
@@ -748,7 +749,7 @@ set_edge_scroll (int method)
&bytes_after, &data);
if (rc == Success && act_type == XA_INTEGER &&
act_format == 8 && nitems >= 2) {
- data[0] = (method == 2) ? 1 : 0;
+ data[0] = (method == GSD_TOUCHPAD_SCROLL_METHOD_TWO_FINGER_SCROLLING) ? 1 : 0;
XChangeDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device,
prop_twofinger, XA_INTEGER, 8,
PropModeReplace, data, nitems);
@@ -910,7 +911,7 @@ set_mouse_settings (GsdMouseManager *manager)
set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_DISABLE_W_TYPING));
#ifdef HAVE_X11_EXTENSIONS_XINPUT_H
set_tap_to_click (g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TAP_TO_CLICK), left_handed);
- set_edge_scroll (g_settings_get_int (manager->priv->touchpad_settings, KEY_SCROLL_METHOD));
+ set_edge_scroll (g_settings_get_enum (manager->priv->touchpad_settings, KEY_SCROLL_METHOD));
set_horiz_scroll (g_settings_get_boolean (manager->priv->touchpad_settings, KEY_PAD_HORIZ_SCROLL));
set_touchpad_enabled (g_settings_get_boolean (manager->priv->touchpad_settings, KEY_TOUCHPAD_ENABLED));
#endif
@@ -969,7 +970,7 @@ touchpad_callback (GSettings *settings,
set_tap_to_click (g_settings_get_boolean (settings, key),
gconf_client_get_bool (client, KEY_LEFT_HANDED, NULL));
} else if (g_str_equal (key, KEY_SCROLL_METHOD)) {
- set_edge_scroll (g_settings_get_int (settings, key));
+ set_edge_scroll (g_settings_get_enum (settings, key));
set_horiz_scroll (g_settings_get_boolean (settings, KEY_PAD_HORIZ_SCROLL));
} else if (g_str_equal (key, KEY_PAD_HORIZ_SCROLL)) {
set_horiz_scroll (g_settings_get_boolean (settings, key));
@@ -979,7 +980,6 @@ touchpad_callback (GSettings *settings,
#endif
g_object_unref (client);
-
}
static guint
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]