Rotate the given edge, not the brother subtree

This commit is contained in:
Bastien Dejean 2013-08-28 12:56:04 +02:00
parent 111680a48b
commit 6cbd905520
3 changed files with 16 additions and 9 deletions

View file

@ -2,12 +2,12 @@
.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 08/27/2013
.\" Date: 08/28/2013
.\" Manual: Bspwm Manual
.\" Source: Bspwm 0.8
.\" Language: English
.\"
.TH "BSPWM" "1" "08/27/2013" "Bspwm 0\&.8" "Bspwm Manual"
.TH "BSPWM" "1" "08/28/2013" "Bspwm 0\&.8" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -461,9 +461,9 @@ Set the splitting ratio of the selected window (0 <
Set the splitting ratio (or pull, or push) the edge located in the given direction in relation to the selected window\&.
.RE
.PP
\fB\-R\fR, \fB\-\-rotate\fR \fI90|270|180\fR
\fB\-R\fR, \fB\-\-rotate\fR \fIDIR\fR \fI90|270|180\fR
.RS 4
Rotate the brother tree of the selected window\&.
Rotate the tree holding the edge located in the given direction in relation to the selected window\&.
.RE
.PP
\fB\-t\fR, \fB\-\-toggle\fR floating|fullscreen|locked[=on|off]

View file

@ -299,8 +299,8 @@ Options
*-e*, *--edge* 'DIR' 'RATIO'|pull|push::
Set the splitting ratio (or pull, or push) the edge located in the given direction in relation to the selected window.
*-R*, *--rotate* '90|270|180'::
Rotate the brother tree of the selected window.
*-R*, *--rotate* 'DIR' '90|270|180'::
Rotate the tree holding the edge located in the given direction in relation to the selected window.
*-t*, *--toggle* floating|fullscreen|locked[=on|off]::
Set or toggle the given state for the selected window.

View file

@ -149,10 +149,10 @@ bool cmd_window(char **args, int num)
direction_t dir;
if (!parse_direction(*args, &dir))
return false;
num--, args++;
node_t *n = find_fence(trg.node, dir);
if (n == NULL)
return false;
num--, args++;
fence_move_t fmo;
if (parse_fence_move(*args, &fmo)) {
move_fence(n, dir, fmo);
@ -177,11 +177,18 @@ bool cmd_window(char **args, int num)
}
} else if (streq("-R", *args) || streq("--rotate", *args)) {
num--, args++;
if (num < 1)
if (num < 2)
return false;
direction_t dir;
if (!parse_direction(*args, &dir))
return false;
node_t *n = find_fence(trg.node, dir);
if (n == NULL)
return false;
num--, args++;
int deg;
if (parse_degree(*args, &deg)) {
rotate_tree(brother_tree(trg.node), deg);
rotate_tree(n, deg);
dirty = true;
} else {
return false;