if (binding->input_code != event->detail)
continue;
- i3_send_msg(I3_IPC_MESSAGE_TYPE_COMMAND, binding->command);
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_RUN_COMMAND, binding->command);
return;
}
}
switch (event->detail) {
case XCB_BUTTON_SCROLL_UP:
+ case XCB_BUTTON_SCROLL_LEFT:
/* Mouse wheel up. We select the previous ws, if any.
* If there is no more workspace, don’t even send the workspace
* command, otherwise (with workspace auto_back_and_forth) we’d end
cur_ws = TAILQ_PREV(cur_ws, ws_head, tailq);
break;
case XCB_BUTTON_SCROLL_DOWN:
+ case XCB_BUTTON_SCROLL_RIGHT:
/* Mouse wheel down. We select the next ws, if any.
* If there is no more workspace, don’t even send the workspace
* command, otherwise (with workspace auto_back_and_forth) we’d end
buffer[outpos] = utf8_name[inpos];
}
buffer[outpos] = '"';
- i3_send_msg(I3_IPC_MESSAGE_TYPE_COMMAND, buffer);
+ i3_send_msg(I3_IPC_MESSAGE_TYPE_RUN_COMMAND, buffer);
free(buffer);
}
* client to finish the protocol. After this event is received, there is no
* further interaction with the tray client.
*
- * See: http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
+ * See: https://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html
*
*/
static void handle_destroy_notify(xcb_destroy_notify_event_t *event) {
case XCB_CONFIGURE_REQUEST:
/* ConfigureRequest, sent by a tray child */
handle_configure_request((xcb_configure_request_event_t *)event);
+ break;
case XCB_RESIZE_REQUEST:
/* ResizeRequest sent by a tray child using override_redirect. */
handle_resize_request((xcb_resize_request_event_t *)event);
ev_prepare_init(xcb_prep, &xcb_prep_cb);
ev_check_init(xcb_chk, &xcb_chk_cb);
+ /* Within an event loop iteration, run the xcb_chk watcher last: other
+ * watchers might call xcb_flush(), which, unexpectedly, can also read
+ * events into the queue (see _xcb_conn_wait). Hence, we need to drain xcb’s
+ * queue last, otherwise we risk dead-locking. */
+ ev_set_priority(xcb_chk, EV_MINPRI);
+
ev_io_start(main_loop, xcb_io);
ev_prepare_start(main_loop, xcb_prep);
ev_check_start(main_loop, xcb_chk);