double clicks only work on the same window with both clicks

This commit is contained in:
Dana Jansens 2003-07-24 18:18:02 +00:00
parent d51702affa
commit f3b42e60d8

View file

@ -259,6 +259,7 @@ static void event(ObEvent *e, void *foo)
{ {
static Time ltime; static Time ltime;
static guint button = 0, state = 0, lbutton = 0; static guint button = 0, state = 0, lbutton = 0;
static lwindow = None;
static int px, py; static int px, py;
gboolean click = FALSE; gboolean click = FALSE;
gboolean dclick = FALSE; gboolean dclick = FALSE;
@ -311,13 +312,18 @@ static void event(ObEvent *e, void *foo)
click = TRUE; click = TRUE;
/* double clicks happen if there were 2 in a row! */ /* double clicks happen if there were 2 in a row! */
if (lbutton == button && if (lbutton == button &&
lwindow == e->data.x.e->xbutton.window &&
e->data.x.e->xbutton.time - dclicktime <= ltime) { e->data.x.e->xbutton.time - dclicktime <= ltime) {
dclick = TRUE; dclick = TRUE;
lbutton = 0; lbutton = 0;
} else } else {
lbutton = button; lbutton = button;
} else lwindow = e->data.x.e->xbutton.window;
}
} else {
lbutton = 0; lbutton = 0;
lwindow = None;
}
button = 0; button = 0;
state = 0; state = 0;