X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fresize.c;h=ee50bfbc694514abe8b43c51a5cffed65365fa69;hb=acc58a6763e497608a9fe4ae9ff4034d18e8641c;hp=05fe50558dba737352efc15333b362cf4ce69e20;hpb=14a4e0c6f8500b981ed36b3e772c65c3ca35749d;p=i3%2Fi3 diff --git a/src/resize.c b/src/resize.c index 05fe5055..ee50bfbc 100644 --- a/src/resize.c +++ b/src/resize.c @@ -1,5 +1,3 @@ -#undef I3__FILE__ -#define I3__FILE__ "resize.c" /* * vim:ts=4:sw=4:expandtab * @@ -11,8 +9,6 @@ */ #include "all.h" -extern xcb_connection_t *conn; - /* * This is an ugly data structure which we need because there is no standard * way of having nested functions (only available as a gcc extension at the @@ -51,7 +47,7 @@ DRAGGING_CB(resize_callback) { xcb_flush(conn); } -bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction) { +bool resize_find_tiling_participants(Con **current, Con **other, direction_t direction, bool both_sides) { DLOG("Find two participants for resizing container=%p in direction=%i\n", other, direction); Con *first = *current; Con *second = NULL; @@ -78,8 +74,14 @@ bool resize_find_tiling_participants(Con **current, Con **other, direction_t dir /* get the counterpart for this resizement */ if (dir_backwards) { second = TAILQ_PREV(first, nodes_head, nodes); + if (second == NULL && both_sides == true) { + second = TAILQ_NEXT(first, nodes); + } } else { second = TAILQ_NEXT(first, nodes); + if (second == NULL && both_sides == true) { + second = TAILQ_PREV(first, nodes_head, nodes); + } } if (second == NULL) { @@ -146,7 +148,7 @@ int resize_graphical_handler(Con *first, Con *second, orientation_t orientation, } mask = XCB_CW_BACK_PIXEL; - values[0] = config.client.focused.border; + values[0] = config.client.focused.border.colorpixel; mask |= XCB_CW_OVERRIDE_REDIRECT; values[1] = 1;