Remove dependency on xcb-event (Thanks Felicitus)

This commit is contained in:
Michael Stapelberg 2011-05-04 19:33:43 +02:00
parent 498a38ac0a
commit 06700c90ef
4 changed files with 11 additions and 10 deletions

View File

@ -37,12 +37,12 @@ CFLAGS += -DOLD_XCB_KEYSYMS_API
endif endif
LDFLAGS += -lm LDFLAGS += -lm
LDFLAGS += -lxcb-event
LDFLAGS += -lxcb-keysyms LDFLAGS += -lxcb-keysyms
ifeq ($(shell pkg-config --exists xcb-util || echo 1),1) ifeq ($(shell pkg-config --exists xcb-util || echo 1),1)
CFLAGS += -DXCB_COMPAT CFLAGS += -DXCB_COMPAT
LDFLAGS += -lxcb-atom LDFLAGS += -lxcb-atom
LDFLAGS += -lxcb-aux LDFLAGS += -lxcb-aux
LDFLAGS += -lxcb-event
else else
LDFLAGS += -lxcb-util LDFLAGS += -lxcb-util
endif endif

View File

@ -26,7 +26,6 @@
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_aux.h> #include <xcb/xcb_aux.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>
#include <X11/keysym.h> #include <X11/keysym.h>

View File

@ -9,7 +9,6 @@
* *
*/ */
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcb_property.h>
#include <xcb/xcb_keysyms.h> #include <xcb/xcb_keysyms.h>
#include <X11/XKBlib.h> #include <X11/XKBlib.h>

View File

@ -156,12 +156,6 @@ void handle_signal(int sig, siginfo_t *info, void *data) {
xcb_connection_t *conn = global_conn; xcb_connection_t *conn = global_conn;
/* setup event handler for key presses */
xcb_event_handlers_t sig_evenths;
memset(&sig_evenths, 0, sizeof(xcb_event_handlers_t));
xcb_event_handlers_init(conn, &sig_evenths);
xcb_event_set_key_press_handler(&sig_evenths, sig_handle_key_press, NULL);
i3Font *font = load_font(conn, config.font); i3Font *font = load_font(conn, config.font);
/* width and height of the popup window, so that the text fits in */ /* width and height of the popup window, so that the text fits in */
@ -202,7 +196,16 @@ void handle_signal(int sig, siginfo_t *info, void *data) {
xcb_flush(conn); xcb_flush(conn);
} }
xcb_event_wait_for_event_loop(&sig_evenths); xcb_generic_event_t *event;
/* Yay, more own eventhandlers… */
while ((event = xcb_wait_for_event(conn))) {
/* Strip off the highest bit (set if the event is generated) */
int type = (event->response_type & 0x7F);
if (type == XCB_KEY_PRESS) {
sig_handle_key_press(NULL, conn, (xcb_key_press_event_t*)event);
}
free(event);
}
} }
/* /*