summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-10 03:44:39 +0000
committerDana Jansens <danakj@orodu.net>2007-05-10 03:44:39 +0000
commitf237e72a307acd7c487c7e2257e24a735c3e7d6e (patch)
tree2a2b612bf7d4d316e8f666e87edcc7e29f77b9d2 /openbox
parent902555c95cfdfc20313a26e8740def7e7dcf4dc7 (diff)
dont count button releases to change the context until the first button pressed is released
Diffstat (limited to 'openbox')
-rw-r--r--openbox/mouse.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/openbox/mouse.c b/openbox/mouse.c
index 9edda8eb..9ca79877 100644
--- a/openbox/mouse.c
+++ b/openbox/mouse.c
@@ -193,8 +193,8 @@ void mouse_event(ObClient *client, XEvent *e)
px = e->xbutton.x_root;
py = e->xbutton.y_root;
- if (pwx == -1) pwx = e->xbutton.x;
- if (pwy == -1) pwy = e->xbutton.y;
+ if (!button) pwx = e->xbutton.x;
+ if (!button) pwy = e->xbutton.y;
button = e->xbutton.button;
state = e->xbutton.state;
@@ -216,7 +216,8 @@ void mouse_event(ObClient *client, XEvent *e)
context = frame_context(client, e->xbutton.window, pwx, pwy);
context = mouse_button_frame_context(context, e->xbutton.button);
- pwx = pwy = -1;
+ if (e->xbutton.button == button)
+ pwx = pwy = -1;
if (e->xbutton.button == button) {
/* clicks are only valid if its released over the window */
@@ -258,7 +259,8 @@ void mouse_event(ObClient *client, XEvent *e)
fire_binding(OB_MOUSE_ACTION_RELEASE, context,
client, e->xbutton.state,
e->xbutton.button,
- e->xbutton.x_root, e->xbutton.y_root,
+ e->xbutton.x_root,
+ e->xbutton.y_root,
e->xbutton.time);
if (click)
fire_binding(OB_MOUSE_ACTION_CLICK, context,
@@ -281,10 +283,8 @@ void mouse_event(ObClient *client, XEvent *e)
context = frame_context(client, e->xmotion.window, pwx, pwy);
context = mouse_button_frame_context(context, button);
- if (ABS(e->xmotion.x_root - px) >=
- config_mouse_threshold ||
- ABS(e->xmotion.y_root - py) >=
- config_mouse_threshold) {
+ if (ABS(e->xmotion.x_root - px) >= config_mouse_threshold ||
+ ABS(e->xmotion.y_root - py) >= config_mouse_threshold) {
/* You can't drag on buttons */
if (context == OB_FRAME_CONTEXT_MAXIMIZE ||