[gnome-settings-daemon] wacom: Implement basic mode switching



commit 4d246750ec52ae3cfd1beee32b3556a138c72519
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Feb 27 17:29:03 2012 +0100

    wacom: Implement basic mode switching
    
    Though the buttons still won't change behaviour.

 plugins/wacom/gsd-wacom-manager.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 4c365ef..8a5ebcb 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -806,7 +806,7 @@ filter_button_events (XEvent          *xevent,
 	button = xev->detail;
 
 	/* FIXME, we'll also need to pass the current mode(s) */
-	wbutton = gsd_wacom_device_get_button (device, button, &dir);
+	wbutton = gsd_wacom_device_get_button (device, button, 0, &dir);
 	if (wbutton == NULL) {
 		g_warning ("Could not find matching button for '%d' on '%s'",
 			   button, gsd_wacom_device_get_name (device));
@@ -827,8 +827,13 @@ filter_button_events (XEvent          *xevent,
 		return GDK_FILTER_REMOVE;
 
 	/* FIXME, we need to switch mode here */
-	if (wbutton->type == WACOM_TABLET_BUTTON_TYPE_HARDCODED)
+	if (wbutton->type == WACOM_TABLET_BUTTON_TYPE_HARDCODED) {
+		int new_mode;
+
+		new_mode = gsd_wacom_device_set_next_mode (device, wbutton->group_id);
+		set_led (device, wbutton->group_id, new_mode);
 		return GDK_FILTER_REMOVE;
+	}
 
 	/* Nothing to do */
 	if (g_settings_get_enum (wbutton->settings, KEY_ACTION_TYPE) == GSD_WACOM_ACTION_TYPE_NONE)



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