From 6a5585254a978087de900e3f7b608f158a7885cc Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 29 Apr 2010 02:31:11 +0200 Subject: [PATCH] Implement gesture button setting and default to right --- extensions/mouse-gestures.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/mouse-gestures.c b/extensions/mouse-gestures.c index e8d0d5ae..c3c93bf0 100644 --- a/extensions/mouse-gestures.c +++ b/extensions/mouse-gestures.c @@ -28,6 +28,7 @@ struct MouseGestureNode { } MouseGestureNode_t; struct _MouseGesture { + MouseButton button; struct MouseGestureNode start; struct MouseGestureNode middle; struct MouseGestureNode end; @@ -37,8 +38,6 @@ struct _MouseGesture { #define DEVIANCE 20 #define MINLENGTH 50 -#define MOUSE_GESTURES_BUTTON MOUSE_BUTTON_MIDDLE - MouseGesture *gesture; void mouse_gesture_clear (MouseGesture *g) @@ -65,7 +64,7 @@ mouse_gestures_button_press_event_cb (GtkWidget* web_view, GdkEvent* event, MidoriBrowser* browser) { - if (event->button.button == MOUSE_GESTURES_BUTTON) + if (event->button.button == gesture->button) { /* If the gesture was previously cleaned, start a new gesture and coordinates. */ @@ -127,7 +126,7 @@ mouse_gestures_button_release_event_cb (GtkWidget* web_view, MidoriView* view) { /* All mouse gestures will use this mouse button */ - if (gesture->last == MOUSE_GESTURES_BUTTON) + if (gesture->last == gesture->button) { /* The initial horizontal move is between the bounds */ if ((gesture->middle.x - gesture->start.x < DEVIANCE) && @@ -285,6 +284,7 @@ mouse_gestures_activate_cb (MidoriExtension* extension, guint i; gesture = mouse_gesture_new (); + gesture->button = midori_extension_get_integer (extension, "button"); browsers = katze_object_get_object (app, "browsers"); i = 0; @@ -304,7 +304,7 @@ extension_init (void) "description", _("Control Midori by moving the mouse"), "version", "0.1", "authors", "Matthias Kruk ", NULL); - midori_extension_install_integer (extension, "button", MOUSE_GESTURES_BUTTON); + midori_extension_install_integer (extension, "button", MOUSE_BUTTON_RIGHT); g_signal_connect (extension, "activate", G_CALLBACK (mouse_gestures_activate_cb), NULL); -- 2.39.5