[awesome-menu] Fix quitting

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-09 17:52:01 +02:00
parent ffec807e9d
commit da0b04d667
1 changed files with 20 additions and 23 deletions

View File

@ -1132,7 +1132,7 @@ handle_kpress(xcb_key_press_event_t *e)
redraw(); redraw();
break; break;
case XK_Escape: case XK_Escape:
status= CANCEL; status = CANCEL;
break; break;
case XK_Return: case XK_Return:
status = STOP; status = STOP;
@ -1359,30 +1359,27 @@ main(int argc, char **argv)
while(status == RUN) while(status == RUN)
{ {
while((ev = xcb_wait_for_event(globalconf.connection))) ev = xcb_wait_for_event(globalconf.connection);
/* Skip errors */
if(ev->response_type == 0)
continue;
switch(ev->response_type & 0x7f)
{ {
/* Skip errors */ case XCB_BUTTON_PRESS:
if(ev->response_type == 0) status = CANCEL;
continue; break;
case XCB_KEY_PRESS:
switch(ev->response_type & 0x7f) handle_kpress((xcb_key_press_event_t *) ev);
{ break;
case XCB_BUTTON_PRESS: case XCB_EXPOSE:
status = CANCEL; if(!((xcb_expose_event_t *) ev)->count)
break; simplewindow_refresh_drawable(globalconf.sw, globalconf.default_screen);
case XCB_KEY_PRESS: break;
handle_kpress((xcb_key_press_event_t *) ev); default:
break; break;
case XCB_EXPOSE:
if(!((xcb_expose_event_t *) ev)->count)
simplewindow_refresh_drawable(globalconf.sw, globalconf.default_screen);
break;
default:
break;
}
p_delete(&ev);
} }
p_delete(&ev);
} }
if(status != CANCEL) if(status != CANCEL)