+ netwmname, utf8_string, 8, strlen("LG3D"), "LG3D");
+ }
+}
+
+void
+event_error(xcb_generic_error_t *e)
+{
+ DNPRINTF(SWM_D_EVENT, "event_error: %s(%u) from %s(%u), sequence: %u, "
+ "resource_id: %u, minor_code: %u\n",
+ xcb_event_get_error_label(e->error_code), e->error_code,
+ xcb_event_get_request_label(e->major_code), e->major_code,
+ e->sequence, e->resource_id, e->minor_code);
+}
+
+void
+event_handle(xcb_generic_event_t *evt)
+{
+ uint8_t type = XCB_EVENT_RESPONSE_TYPE(evt);
+
+ DNPRINTF(SWM_D_EVENT, "XCB Event: %s(%d)\n",
+ xcb_event_get_label(XCB_EVENT_RESPONSE_TYPE(evt)),
+ XCB_EVENT_RESPONSE_TYPE(evt));
+
+ switch (type) {
+#define EVENT(type, callback) case type: callback((void *)evt); return
+ EVENT(0, event_error);
+ EVENT(XCB_BUTTON_PRESS, buttonpress);
+ /*EVENT(XCB_BUTTON_RELEASE, buttonpress);*/
+ /*EVENT(XCB_CIRCULATE_NOTIFY, );*/
+ /*EVENT(XCB_CIRCULATE_REQUEST, );*/
+ EVENT(XCB_CLIENT_MESSAGE, clientmessage);
+ /*EVENT(XCB_COLORMAP_NOTIFY, );*/
+ EVENT(XCB_CONFIGURE_NOTIFY, configurenotify);
+ EVENT(XCB_CONFIGURE_REQUEST, configurerequest);
+ /*EVENT(XCB_CREATE_NOTIFY, );*/
+ EVENT(XCB_DESTROY_NOTIFY, destroynotify);
+ EVENT(XCB_ENTER_NOTIFY, enternotify);
+ EVENT(XCB_EXPOSE, expose);
+ /*EVENT(XCB_FOCUS_IN, );*/
+ /*EVENT(XCB_FOCUS_OUT, );*/
+ /*EVENT(XCB_GRAPHICS_EXPOSURE, );*/
+ /*EVENT(XCB_GRAVITY_NOTIFY, );*/
+ EVENT(XCB_KEY_PRESS, keypress);
+ /*EVENT(XCB_KEY_RELEASE, keypress);*/
+ /*EVENT(XCB_KEYMAP_NOTIFY, );*/
+ /*EVENT(XCB_LEAVE_NOTIFY, );*/
+ EVENT(XCB_MAP_NOTIFY, mapnotify);
+ EVENT(XCB_MAP_REQUEST, maprequest);
+ EVENT(XCB_MAPPING_NOTIFY, mappingnotify);
+ /*EVENT(XCB_MOTION_NOTIFY, );*/
+ /*EVENT(XCB_NO_EXPOSURE, );*/
+ EVENT(XCB_PROPERTY_NOTIFY, propertynotify);
+ /*EVENT(XCB_REPARENT_NOTIFY, );*/
+ /*EVENT(XCB_RESIZE_REQUEST, );*/
+ /*EVENT(XCB_SELECTION_CLEAR, );*/
+ /*EVENT(XCB_SELECTION_NOTIFY, );*/
+ /*EVENT(XCB_SELECTION_REQUEST, );*/
+ EVENT(XCB_UNMAP_NOTIFY, unmapnotify);
+ /*EVENT(XCB_VISIBILITY_NOTIFY, visibilitynotify);*/
+#undef EVENT
+ }
+ if (type - xrandr_eventbase == XCB_RANDR_SCREEN_CHANGE_NOTIFY)
+ screenchange((void *)evt);