+ /* don’t handle dockarea cons, they must not be focused */
+ if (con->parent->type == CT_DOCKAREA)
+ goto done;
+
+ const bool is_left_or_right_click = (event->detail == XCB_BUTTON_INDEX_1 ||
+ event->detail == XCB_BUTTON_INDEX_3);
+
+ /* if the user has bound an action to this click, it should override the
+ * default behavior. */
+ if (dest == CLICK_DECORATION || dest == CLICK_INSIDE || dest == CLICK_BORDER) {
+ Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
+ /* clicks over a window decoration will always trigger the binding and
+ * clicks on the inside of the window will only trigger a binding if
+ * the --whole-window flag was given for the binding. */
+ if (bind && ((dest == CLICK_DECORATION || bind->whole_window) ||
+ (dest == CLICK_BORDER && bind->border))) {
+ CommandResult *result = run_binding(bind, con);
+
+ /* ASYNC_POINTER eats the event */
+ xcb_allow_events(conn, XCB_ALLOW_ASYNC_POINTER, event->time);
+ xcb_flush(conn);
+
+ if (result->needs_tree_render)
+ tree_render();
+
+ command_result_free(result);
+
+ return 0;
+ }
+ }
+
+ /* There is no default behavior for button release events so we are done. */
+ if (event->response_type == XCB_BUTTON_RELEASE) {
+ goto done;
+ }
+