Use XCB_BUTTON_INDEX defines for mouse buttons
Patch status: merged
Patch by Campbell Barton
To apply this patch, use:
curl http://cr.i3wm.org/patch/569/raw.patch | git am
b/src/click.c
| 13 |
@@ -243,7 +243,7 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod |
| 14 |
/* 5: resize (floating) if this was a (left or right) click on the |
| 15 |
* left/right/bottom border, or a right click on the decoration. |
| 16 |
* also try resizing (tiling) if it was a click on the top */ |
| 17 |
- if (mod_pressed && event->detail == 3) {
|
| 18 |
+ if (mod_pressed && event->detail == XCB_BUTTON_INDEX_3) {
|
| 19 |
DLOG("floating resize due to floatingmodifier\n");
|
| 20 |
floating_resize_window(floatingcon, proportional, event); |
| 21 |
return 1; |
| 22 |
@@ -256,7 +256,7 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod |
| 23 |
goto done; |
| 24 |
} |
| 25 |
|
| 26 |
- if (dest == CLICK_DECORATION && event->detail == 3) {
|
| 27 |
+ if (dest == CLICK_DECORATION && event->detail == XCB_BUTTON_INDEX_3) {
|
| 28 |
DLOG("floating resize due to decoration right click\n");
|
| 29 |
floating_resize_window(floatingcon, proportional, event); |
| 30 |
return 1; |
| 31 |
@@ -285,7 +285,7 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod |
| 32 |
} |
| 33 |
|
| 34 |
/* 7: floating modifier pressed, initiate a resize */ |
| 35 |
- if (dest == CLICK_INSIDE && mod_pressed && event->detail == 3) {
|
| 36 |
+ if (dest == CLICK_INSIDE && mod_pressed && event->detail == XCB_BUTTON_INDEX_3) {
|
| 37 |
if (floating_mod_on_tiled_client(con, event)) |
| 38 |
return 1; |
| 39 |
} |