return;
}
switch (event->detail) {
- case 4:
+ case XCB_BUTTON_SCROLL_UP:
/* 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 5:
+ case XCB_BUTTON_SCROLL_DOWN:
/* 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
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);
+ const bool is_left_or_right_click = (event->detail == XCB_BUTTON_CLICK_LEFT ||
+ event->detail == XCB_BUTTON_CLICK_RIGHT);
/* if the user has bound an action to this click, it should override the
* default behavior. */
/* 1: see if the user scrolled on the decoration of a stacked/tabbed con */
if (in_stacked &&
dest == CLICK_DECORATION &&
- (event->detail == XCB_BUTTON_INDEX_4 ||
- event->detail == XCB_BUTTON_INDEX_5)) {
+ (event->detail == XCB_BUTTON_SCROLL_UP ||
+ event->detail == XCB_BUTTON_SCROLL_DOWN)) {
DLOG("Scrolling on a window decoration\n");
orientation_t orientation = (con->parent->layout == L_STACKED ? VERT : HORIZ);
/* Focus the currently focused container on the same level that the
* #557), we first check if scrolling is possible at all. */
bool scroll_prev_possible = (TAILQ_PREV(focused, nodes_head, nodes) != NULL);
bool scroll_next_possible = (TAILQ_NEXT(focused, nodes) != NULL);
- if (event->detail == XCB_BUTTON_INDEX_4 && scroll_prev_possible)
+ if (event->detail == XCB_BUTTON_SCROLL_UP && scroll_prev_possible)
tree_next('p', orientation);
- else if (event->detail == XCB_BUTTON_INDEX_5 && scroll_next_possible)
+ else if (event->detail == XCB_BUTTON_SCROLL_DOWN && scroll_next_possible)
tree_next('n', orientation);
goto done;
}
floating_raise_con(floatingcon);
/* 4: floating_modifier plus left mouse button drags */
- if (mod_pressed && event->detail == XCB_BUTTON_INDEX_1) {
+ if (mod_pressed && event->detail == XCB_BUTTON_CLICK_LEFT) {
floating_drag_window(floatingcon, event);
return 1;
}
/* 5: resize (floating) if this was a (left or right) click on the
* left/right/bottom border, or a right click on the decoration.
* also try resizing (tiling) if it was a click on the top */
- if (mod_pressed && event->detail == XCB_BUTTON_INDEX_3) {
+ if (mod_pressed && event->detail == XCB_BUTTON_CLICK_RIGHT) {
DLOG("floating resize due to floatingmodifier\n");
floating_resize_window(floatingcon, proportional, event);
return 1;
goto done;
}
- if (dest == CLICK_DECORATION && event->detail == XCB_BUTTON_INDEX_3) {
+ if (dest == CLICK_DECORATION && event->detail == XCB_BUTTON_CLICK_RIGHT) {
DLOG("floating resize due to decoration right click\n");
floating_resize_window(floatingcon, proportional, event);
return 1;
/* 6: dragging, if this was a click on a decoration (which did not lead
* to a resize) */
if (!in_stacked && dest == CLICK_DECORATION &&
- (event->detail == XCB_BUTTON_INDEX_1)) {
+ (event->detail == XCB_BUTTON_CLICK_LEFT)) {
floating_drag_window(floatingcon, event);
return 1;
}
}
/* 7: floating modifier pressed, initiate a resize */
- if (dest == CLICK_INSIDE && mod_pressed && event->detail == XCB_BUTTON_INDEX_3) {
+ if (dest == CLICK_INSIDE && mod_pressed && event->detail == XCB_BUTTON_CLICK_RIGHT) {
if (floating_mod_on_tiled_client(con, event))
return 1;
}