]> Dogcows Code - chaz/openbox/blobdiff - plugins/mouse/mouse.c
didnt belong
[chaz/openbox] / plugins / mouse / mouse.c
index 0cb6b5c0095213a7bdd423bf5c1062668cfa784b..ea943f5a2820ac1a838efc4bf5a104ea4a82f660 100644 (file)
@@ -9,6 +9,8 @@
 #include "mouse.h"
 #include <glib.h>
 
+static int drag_threshold = 3;
+
 /* GData of GSList*s of PointerBinding*s. */
 static GData *bound_contexts;
 
@@ -270,14 +272,17 @@ static void event(ObEvent *e, void *foo)
 
     case Event_X_MotionNotify:
         if (button) {
-            drag = TRUE;
             dx = e->data.x.e->xmotion.x_root - px;
             dy = e->data.x.e->xmotion.y_root - py;
-            context = engine_get_context(e->data.x.client,
-                                         e->data.x.e->xbutton.window);
-            fire_motion(MouseAction_Motion, context,
-                        e->data.x.client, e->data.x.e->xmotion.state,
-                        button, cx, cy, cw, ch, dx, dy, FALSE, corner);
+            if (ABS(dx) >= drag_threshold || ABS(dy) >= drag_threshold)
+                drag = TRUE;
+            if (drag) {
+                context = engine_get_context(e->data.x.client,
+                                             e->data.x.e->xbutton.window);
+                fire_motion(MouseAction_Motion, context,
+                            e->data.x.client, e->data.x.e->xmotion.state,
+                            button, cx, cy, cw, ch, dx, dy, FALSE, corner);
+            }
         }
         break;
 
@@ -363,10 +368,14 @@ static void binddef()
     a = action_new(action_resize);
     mbind("A-3", "frame", MouseAction_Motion, a);
 
-    a = action_new(action_focusraise);
+    a = action_new(action_focus);
     mbind("1", "titlebar", MouseAction_Press, a);
-    a = action_new(action_focusraise);
+    a = action_new(action_focus);
     mbind("1", "handle", MouseAction_Press, a);
+    a = action_new(action_raise);
+    mbind("1", "titlebar", MouseAction_Click, a);
+    a = action_new(action_raise);
+    mbind("1", "handle", MouseAction_Click, a);
     a = action_new(action_lower);
     mbind("2", "titlebar", MouseAction_Press, a);
     a = action_new(action_lower);
@@ -376,7 +385,7 @@ static void binddef()
     a = action_new(action_lower);
     mbind("A-3", "frame", MouseAction_Click, a);
 
-    a = action_new(action_focusraise);
+    a = action_new(action_focus);
     mbind("1", "client", MouseAction_Press, a);
 
     a = action_new(action_toggle_shade);
@@ -398,6 +407,8 @@ static void binddef()
     mbind("1", "icon", MouseAction_DClick, a);
     a = action_new(action_close);
     mbind("1", "close", MouseAction_Click, a);
+    a = action_new(action_kill);
+    mbind("2", "close", MouseAction_Click, a);
     a = action_new(action_toggle_omnipresent);
     mbind("1", "alldesktops", MouseAction_Click, a);
 
This page took 0.022217 seconds and 4 git commands to generate.