From 6cbd90552036b18fd7a0f81cf44984400f975067 Mon Sep 17 00:00:00 2001 From: Bastien Dejean Date: Wed, 28 Aug 2013 12:56:04 +0200 Subject: [PATCH] Rotate the given edge, not the brother subtree --- doc/bspwm.1 | 8 ++++---- doc/bspwm.1.txt | 4 ++-- messages.c | 13 ++++++++++--- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/bspwm.1 b/doc/bspwm.1 index 7558515..8ae4851 100644 --- a/doc/bspwm.1 +++ b/doc/bspwm.1 @@ -2,12 +2,12 @@ .\" Title: bspwm .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" 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] diff --git a/doc/bspwm.1.txt b/doc/bspwm.1.txt index bf30cde..0cbef3f 100644 --- a/doc/bspwm.1.txt +++ b/doc/bspwm.1.txt @@ -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. diff --git a/messages.c b/messages.c index 3d1c764..6b02970 100644 --- a/messages.c +++ b/messages.c @@ -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, °)) { - rotate_tree(brother_tree(trg.node), deg); + rotate_tree(n, deg); dirty = true; } else { return false;