Fix an unbalanced lua stack

event_button_callback() pops the top element from the stack, but
event_emit_button() doesn't. This got was expecting both to pop the top from the
stack so Bad Things(tm) happen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2010-10-10 13:32:47 +02:00
parent 38d4602425
commit e55ed50b89
1 changed files with 5 additions and 10 deletions

15
event.c
View File

@ -189,23 +189,18 @@ event_handle_button(xcb_button_press_event_t *ev)
/* Push the drawin */
luaA_object_push(globalconf.L, drawin);
/* Duplicate the drawin */
lua_pushvalue(globalconf.L, -1);
/* Handle the button event on it */
event_button_callback(ev, &drawin->buttons, -1, 1, NULL);
/* And handle the button event on it again */
/* and handle the button raw button event */
event_emit_button(ev);
/* check if any button object matches */
event_button_callback(ev, &drawin->buttons, -1, 1, NULL);
}
else if((c = client_getbyframewin(ev->event)))
{
luaA_object_push(globalconf.L, c);
/* Duplicate the client */
lua_pushvalue(globalconf.L, -1);
/* And handle the button raw button event */
event_emit_button(ev);
/* then check if any button objects match */
event_button_callback(ev, &c->buttons, -1, 1, NULL);
/* And handle the button event on it again */
event_emit_button(ev);
xcb_allow_events(globalconf.connection,
XCB_ALLOW_REPLAY_POINTER,
XCB_CURRENT_TIME);