handle the XGetGeomtry failing for button releases

This commit is contained in:
Dana Jansens 2003-08-20 17:06:08 +00:00
parent 9e3d680cf7
commit 533992f5aa

View file

@ -1,5 +1,6 @@
#include "openbox.h" #include "openbox.h"
#include "config.h" #include "config.h"
#include "xerror.h"
#include "action.h" #include "action.h"
#include "event.h" #include "event.h"
#include "client.h" #include "client.h"
@ -228,27 +229,32 @@ void mouse_event(ObClient *client, ObFrameContext context, XEvent *e)
int junk1, junk2; int junk1, junk2;
Window wjunk; Window wjunk;
guint ujunk, b, w, h; guint ujunk, b, w, h;
XGetGeometry(ob_display, e->xbutton.window, Status s;
&wjunk, &junk1, &junk2, &w, &h, &b, &ujunk); xerror_set_ignore(TRUE);
if (e->xbutton.x >= (signed)-b && s = XGetGeometry(ob_display, e->xbutton.window,
e->xbutton.y >= (signed)-b && &wjunk, &junk1, &junk2, &w, &h, &b, &ujunk);
e->xbutton.x < (signed)(w+b) && xerror_set_ignore(FALSE);
e->xbutton.y < (signed)(h+b)) { if (s == Success) {
click = TRUE; if (e->xbutton.x >= (signed)-b &&
/* double clicks happen if there were 2 in a row! */ e->xbutton.y >= (signed)-b &&
if (lbutton == button && e->xbutton.x < (signed)(w+b) &&
lwindow == e->xbutton.window && e->xbutton.y < (signed)(h+b)) {
e->xbutton.time - config_mouse_dclicktime <= click = TRUE;
ltime) { /* double clicks happen if there were 2 in a row! */
dclick = TRUE; if (lbutton == button &&
lbutton = 0; lwindow == e->xbutton.window &&
e->xbutton.time - config_mouse_dclicktime <=
ltime) {
dclick = TRUE;
lbutton = 0;
} else {
lbutton = button;
lwindow = e->xbutton.window;
}
} else { } else {
lbutton = button; lbutton = 0;
lwindow = e->xbutton.window; lwindow = None;
} }
} else {
lbutton = 0;
lwindow = None;
} }
button = 0; button = 0;