only button 1 can use menu items

This commit is contained in:
Dana Jansens 2003-05-22 21:33:44 +00:00
parent f249e01616
commit d3980aa459

View file

@ -931,18 +931,20 @@ static void event_handle_menu(Menu *menu, Client *client, XEvent *e)
/* grab_pointer_window(FALSE, None, menu->frame);*/ /* grab_pointer_window(FALSE, None, menu->frame);*/
entry = menu_find_entry(menu, e->xbutton.window); if (e->xbutton.button == 1) {
if (entry) { entry = menu_find_entry(menu, e->xbutton.window);
int junk; if (entry) {
Window wjunk; int junk;
guint ujunk, b, w, h; Window wjunk;
XGetGeometry(ob_display, e->xbutton.window, guint ujunk, b, w, h;
&wjunk, &junk, &junk, &w, &h, &b, &ujunk); XGetGeometry(ob_display, e->xbutton.window,
if (e->xbutton.x >= (signed)-b && &wjunk, &junk, &junk, &w, &h, &b, &ujunk);
e->xbutton.y >= (signed)-b && if (e->xbutton.x >= (signed)-b &&
e->xbutton.x < (signed)(w+b) && e->xbutton.y >= (signed)-b &&
e->xbutton.y < (signed)(h+b)) { e->xbutton.x < (signed)(w+b) &&
menu_entry_fire(entry); e->xbutton.y < (signed)(h+b)) {
menu_entry_fire(entry);
}
} }
} }