summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-07-24 18:18:02 +0000
committerDana Jansens <danakj@orodu.net>2003-07-24 18:18:02 +0000
commitf3b42e60d8eb638d73c3d6aaa93196c283532b7e (patch)
tree4ef9101c83ad357df59bc7bbf63f826cf1b3195d
parentd51702affa3e3895f9fca218de39690f8958b500 (diff)
double clicks only work on the same window with both clicks
-rw-r--r--plugins/mouse/mouse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/mouse/mouse.c b/plugins/mouse/mouse.c
index 6ac7bab0..c9982c88 100644
--- a/plugins/mouse/mouse.c
+++ b/plugins/mouse/mouse.c
@@ -259,6 +259,7 @@ static void event(ObEvent *e, void *foo)
{
static Time ltime;
static guint button = 0, state = 0, lbutton = 0;
+ static lwindow = None;
static int px, py;
gboolean click = FALSE;
gboolean dclick = FALSE;
@@ -311,13 +312,18 @@ static void event(ObEvent *e, void *foo)
click = TRUE;
/* double clicks happen if there were 2 in a row! */
if (lbutton == button &&
+ lwindow == e->data.x.e->xbutton.window &&
e->data.x.e->xbutton.time - dclicktime <= ltime) {
dclick = TRUE;
lbutton = 0;
- } else
+ } else {
lbutton = button;
- } else
+ lwindow = e->data.x.e->xbutton.window;
+ }
+ } else {
lbutton = 0;
+ lwindow = None;
+ }
button = 0;
state = 0;