Treat stacking containers as if they are in vertical orientation, add testcase
This commit is contained in:
14
src/con.c
14
src/con.c
@ -376,3 +376,17 @@ void con_move_to_workspace(Con *con, Con *workspace) {
|
||||
con_detach(con);
|
||||
con_attach(con, next);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the orientation of the given container (for stacked containers,
|
||||
* vertical orientation is used regardless of the actual orientation of the
|
||||
* container).
|
||||
*
|
||||
*/
|
||||
int con_orientation(Con *con) {
|
||||
/* stacking containers behave like they are in vertical orientation */
|
||||
if (con->layout == L_STACKED)
|
||||
return VERT;
|
||||
|
||||
return con->orientation;
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ void tree_render() {
|
||||
void tree_next(char way, orientation_t orientation) {
|
||||
/* 1: get the first parent with the same orientation */
|
||||
Con *parent = focused->parent;
|
||||
while (parent->orientation != orientation) {
|
||||
while (con_orientation(parent) != orientation) {
|
||||
LOG("need to go one level further up\n");
|
||||
/* if the current parent is an output, we are at a workspace
|
||||
* and the orientation still does not match */
|
||||
@ -377,7 +377,7 @@ void tree_move(char way, orientation_t orientation) {
|
||||
if (focused->type == CT_WORKSPACE)
|
||||
return;
|
||||
bool level_changed = false;
|
||||
while (parent->orientation != orientation) {
|
||||
while (con_orientation(parent) != orientation) {
|
||||
LOG("need to go one level further up\n");
|
||||
/* if the current parent is an output, we are at a workspace
|
||||
* and the orientation still does not match */
|
||||
|
Reference in New Issue
Block a user