[Xfce4-commits] <midori:master> Implement gesture button setting and default to right

Christian Dywan noreply at xfce.org
Thu Apr 29 02:38:03 CEST 2010


Updating branch refs/heads/master
         to 6a5585254a978087de900e3f7b608f158a7885cc (commit)
       from 43baf4706a000a8fb8047f70decf4990d998b227 (commit)

commit 6a5585254a978087de900e3f7b608f158a7885cc
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Apr 29 02:31:11 2010 +0200

    Implement gesture button setting and default to right

 extensions/mouse-gestures.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/extensions/mouse-gestures.c b/extensions/mouse-gestures.c
index e8d0d5a..c3c93bf 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 <mkruk at matthiaskruk.de>", 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);



More information about the Xfce4-commits mailing list