all repos — openbox @ 1588c852ec33d395834a4c30a5a4ddebc42489b7

openbox fork - make it a bit more like ryudo

add a drag threshold
Dana Jansens danakj@orodu.net
commit

1588c852ec33d395834a4c30a5a4ddebc42489b7

parent

e442c6cc56813ac2d80ddf956603b6d0123d8145

1 files changed, 11 insertions(+), 6 deletions(-)

jump to
M plugins/mouse/mouse.cplugins/mouse/mouse.c

@@ -9,6 +9,8 @@ #include "translate.h"

#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 @@ break;

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;