X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=plugins%2Fmouse%2Fmouse.c;h=68c44533a400fd569d3ba7d1f298307a178f547d;hb=7da335f944257f81e2adfe7924430d1996d1af6d;hp=6ac7bab0a69e703e1eaf87794f765dbd3aa75c41;hpb=0e69ae2b96fb4dd7435ebe15645d1384d11a3ef7;p=chaz%2Fopenbox diff --git a/plugins/mouse/mouse.c b/plugins/mouse/mouse.c index 6ac7bab0..68c44533 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 Window 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;