]> git.lizzy.rs Git - bspwm.git/commitdiff
Make the focused and active modifiers coherent
authorBastien Dejean <nihilhill@gmail.com>
Fri, 14 Dec 2018 17:10:19 +0000 (18:10 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 14 Dec 2018 17:10:19 +0000 (18:10 +0100)
doc/bspwm.1
doc/bspwm.1.asciidoc
src/parse.c
src/query.c
src/types.h

index 3503b87913d36e25488ad64978fd1558936161de..af8b41f3031d357d8127e74744c1e71d0b319d0d 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 12/12/2018
+.\"      Date: 12/14/2018
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.5-24-g0f5a69b
+.\"    Source: Bspwm 0.9.5-25-g93c6de1
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "12/12/2018" "Bspwm 0\&.9\&.5\-24\-g0f5a69b" "Bspwm Manual"
+.TH "BSPWM" "1" "12/14/2018" "Bspwm 0\&.9\&.5\-25\-g93c6de1" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -102,7 +102,7 @@ Select a node\&.
 .nf
 NODE_SEL := [NODE_SEL#](DIR|CYCLE_DIR|PATH|any|last|newest|
                         older|newer|focused|pointed|biggest|smallest|
-                        <node_id>)[\&.[!]focused][\&.[!]automatic][\&.[!]local][\&.[!]active]
+                        <node_id>)[\&.[!]focused][\&.[!]active][\&.[!]automatic][\&.[!]local]
                                   [\&.[!]leaf][\&.[!]window][\&.[!]STATE][\&.[!]FLAG][\&.[!]LAYER]
                                   [\&.[!]same_class][\&.[!]descendant_of][\&.[!]ancestor_of]
 
@@ -240,12 +240,17 @@ Jumps to the node holding the edge in the given direction\&.
 .PP
 [!]focused
 .RS 4
-Only consider focused or unfocused nodes\&.
+Only consider the focused node\&.
+.RE
+.PP
+[!]active
+.RS 4
+Only consider nodes that are the focused node of their desktop\&.
 .RE
 .PP
 [!]automatic
 .RS 4
-Only consider nodes in automatic or manual insertion mode\&. See also
+Only consider nodes in automatic insertion mode\&. See also
 \fB\-\-presel\-dir\fR
 under
 \fBNode\fR
@@ -256,52 +261,47 @@ section below\&.
 .PP
 [!]local
 .RS 4
-Only consider nodes in or not in the reference desktop\&.
-.RE
-.PP
-[!]active
-.RS 4
-Only consider nodes in or not in the active desktop of their monitor\&.
+Only consider nodes in the reference desktop\&.
 .RE
 .PP
 [!]leaf
 .RS 4
-Only consider leaves or internal nodes\&.
+Only consider leaf nodes\&.
 .RE
 .PP
 [!]window
 .RS 4
-Only consider nodes that hold or don\(cqt hold a window\&.
+Only consider nodes that hold a window\&.
 .RE
 .PP
 [!](tiled|pseudo_tiled|floating|fullscreen)
 .RS 4
-Only consider windows in or not in the given state\&.
+Only consider windows in the given state\&.
 .RE
 .PP
 [!]same_class
 .RS 4
-Only consider windows that have or don\(cqt have the same class as the reference window\&.
+Only consider windows that have the same class as the reference window\&.
 .RE
 .PP
 [!]descendant_of
 .RS 4
-Only consider nodes that are or aren\(cqt descendants of the reference node\&.
+Only consider nodes that are descendants of the reference node\&.
 .RE
 .PP
 [!]ancestor_of
 .RS 4
-Only consider nodes that are or aren\(cqt ancestors of the reference node\&.
+Only consider nodes that are ancestors of the reference node\&.
 .RE
 .PP
 [!](hidden|sticky|private|locked|marked|urgent)
 .RS 4
-Only consider windows that have or don\(cqt have the given flag set\&.
+Only consider windows that have the given flag set\&.
 .RE
 .PP
 [!](below|normal|above)
 .RS 4
-Only consider windows in or not in the given layer\&.
+Only consider windows in the given layer\&.
 .RE
 .RE
 .SS "Desktop"
@@ -314,7 +314,8 @@ Select a desktop\&.
 .nf
 DESKTOP_SEL := [DESKTOP_SEL#](CYCLE_DIR|any|last|newest|older|newer|
                               [MONITOR_SEL:](focused|^<n>)|
-                              <desktop_id>|<desktop_name>)[\&.[!]occupied][\&.[!]focused][\&.[!]urgent][\&.[!]local]
+                              <desktop_id>|<desktop_name>)[\&.[!]focused][\&.[!]active]
+                                                          [\&.[!]occupied][\&.[!]urgent][\&.[!]local]
 .fi
 .if n \{\
 .RE
@@ -389,24 +390,29 @@ Selects the desktop with the given name\&.
 \fBModifiers\fR
 .RS 4
 .PP
-[!]occupied
+[!]focused
 .RS 4
-Only consider occupied or free desktops\&.
+Only consider the focused desktop\&.
 .RE
 .PP
-[!]focused
+[!]active
+.RS 4
+Only consider desktops that are the focused desktop of their monitor\&.
+.RE
+.PP
+[!]occupied
 .RS 4
-Only consider focused or unfocused desktops\&.
+Only consider occupied desktops\&.
 .RE
 .PP
 [!]urgent
 .RS 4
-Only consider urgent or non urgent desktops\&.
+Only consider urgent desktops\&.
 .RE
 .PP
 [!]local
 .RS 4
-Only consider desktops inside or outside of the reference monitor\&.
+Only consider desktops inside the reference monitor\&.
 .RE
 .RE
 .SS "Monitor"
@@ -419,7 +425,7 @@ Select a monitor\&.
 .nf
 MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|any|last|newest|older|newer|
                               focused|pointed|primary|^<n>|
-                              <monitor_id>|<monitor_name>)[\&.[!]occupied][\&.[!]focused]
+                              <monitor_id>|<monitor_name>)[\&.[!]focused][\&.[!]occupied]
 .fi
 .if n \{\
 .RE
@@ -507,14 +513,14 @@ Selects the monitor with the given name\&.
 \fBModifiers\fR
 .RS 4
 .PP
-[!]occupied
+[!]focused
 .RS 4
-Only consider monitors where the focused desktop is occupied or free\&.
+Only consider the focused monitor\&.
 .RE
 .PP
-[!]focused
+[!]occupied
 .RS 4
-Only consider focused or unfocused monitors\&.
+Only consider monitors where the focused desktop is occupied\&.
 .RE
 .RE
 .SH "WINDOW STATES"
index 3febdc489ccd57d0ed71d910871d2d48162d01dd..86cf98ff9a31e3b8ba86f9344cca8498378c64e1 100644 (file)
@@ -76,7 +76,7 @@ Select a node.
 ----
 NODE_SEL := [NODE_SEL#](DIR|CYCLE_DIR|PATH|any|last|newest|
                         older|newer|focused|pointed|biggest|smallest|
-                        <node_id>)[.[!]focused][.[!]automatic][.[!]local][.[!]active]
+                        <node_id>)[.[!]focused][.[!]active][.[!]automatic][.[!]local]
                                   [.[!]leaf][.[!]window][.[!]STATE][.[!]FLAG][.[!]LAYER]
                                   [.[!]same_class][.[!]descendant_of][.[!]ancestor_of]
 
@@ -156,41 +156,43 @@ parent::
 Modifiers
 ^^^^^^^^^
 
+
+
 [!]focused::
-       Only consider focused or unfocused nodes.
+       Only consider the focused node.
+
+[!]active::
+       Only consider nodes that are the focused node of their desktop.
 
 [!]automatic::
-       Only consider nodes in automatic or manual insertion mode. See also *--presel-dir* under *Node* in the *DOMAINS* section below.
+       Only consider nodes in automatic insertion mode. See also *--presel-dir* under *Node* in the *DOMAINS* section below.
 
 [!]local::
-       Only consider nodes in or not in the reference desktop.
-
-[!]active::
-       Only consider nodes in or not in the active desktop of their monitor.
+       Only consider nodes in the reference desktop.
 
 [!]leaf::
-       Only consider leaves or internal nodes.
+       Only consider leaf nodes.
 
 [!]window::
-       Only consider nodes that hold or don't hold a window.
+       Only consider nodes that hold a window.
 
 [!](tiled|pseudo_tiled|floating|fullscreen)::
-       Only consider windows in or not in the given state.
+       Only consider windows in the given state.
 
 [!]same_class::
-       Only consider windows that have or don't have the same class as the reference window.
+       Only consider windows that have the same class as the reference window.
 
 [!]descendant_of::
-       Only consider nodes that are or aren't descendants of the reference node.
+       Only consider nodes that are descendants of the reference node.
 
 [!]ancestor_of::
-       Only consider nodes that are or aren't ancestors of the reference node.
+       Only consider nodes that are ancestors of the reference node.
 
 [!](hidden|sticky|private|locked|marked|urgent)::
-       Only consider windows that have or don't have the given flag set.
+       Only consider windows that have the given flag set.
 
 [!](below|normal|above)::
-       Only consider windows in or not in the given layer.
+       Only consider windows in the given layer.
 
 Desktop
 ~~~~~~~
@@ -200,7 +202,8 @@ Select a desktop.
 ----
 DESKTOP_SEL := [DESKTOP_SEL#](CYCLE_DIR|any|last|newest|older|newer|
                               [MONITOR_SEL:](focused|^<n>)|
-                              <desktop_id>|<desktop_name>)[.[!]occupied][.[!]focused][.[!]urgent][.[!]local]
+                              <desktop_id>|<desktop_name>)[.[!]focused][.[!]active]
+                                                          [.[!]occupied][.[!]urgent][.[!]local]
 ----
 
 Descriptors
@@ -239,17 +242,20 @@ focused::
 Modifiers
 ^^^^^^^^^
 
-[!]occupied::
-       Only consider occupied or free desktops.
-
 [!]focused::
-       Only consider focused or unfocused desktops.
+       Only consider the focused desktop.
+
+[!]active::
+       Only consider desktops that are the focused desktop of their monitor.
+
+[!]occupied::
+       Only consider occupied desktops.
 
 [!]urgent::
-       Only consider urgent or non urgent desktops.
+       Only consider urgent desktops.
 
 [!]local::
-       Only consider desktops inside or outside of the reference monitor.
+       Only consider desktops inside the reference monitor.
 
 Monitor
 ~~~~~~~
@@ -259,7 +265,7 @@ Select a monitor.
 ----
 MONITOR_SEL := [MONITOR_SEL#](DIR|CYCLE_DIR|any|last|newest|older|newer|
                               focused|pointed|primary|^<n>|
-                              <monitor_id>|<monitor_name>)[.[!]occupied][.[!]focused]
+                              <monitor_id>|<monitor_name>)[.[!]focused][.[!]occupied]
 ----
 
 Descriptors
@@ -308,11 +314,12 @@ primary::
 Modifiers
 ^^^^^^^^^
 
+[!]focused::
+       Only consider the focused monitor.
+
 [!]occupied::
-       Only consider monitors where the focused desktop is occupied or free.
+       Only consider monitors where the focused desktop is occupied.
 
-[!]focused::
-       Only consider focused or unfocused monitors.
 
 
 Window States
index c389c2f4513e058c7447091368f277be051e6b70..8035d1081963004b37a673ff1aad07306bea540c 100644 (file)
@@ -500,6 +500,7 @@ bool parse_desktop_modifiers(char *desc, desktop_select_t *sel)
                } else if (streq("!occupied", tok)) {
                        sel->occupied = OPTION_FALSE;
                GET_MOD(focused)
+               GET_MOD(active)
                GET_MOD(urgent)
                GET_MOD(local)
                } else {
@@ -522,8 +523,8 @@ bool parse_node_modifiers(char *desc, node_select_t *sel)
                        sel->tiled = OPTION_FALSE;
                GET_MOD(automatic)
                GET_MOD(focused)
-               GET_MOD(local)
                GET_MOD(active)
+               GET_MOD(local)
                GET_MOD(leaf)
                GET_MOD(window)
                GET_MOD(pseudo_tiled)
index dfdee88689722713eecbbfa09b39cfacbe6faaf0..c10e018e0a63269c5c42e7d531f63cfcf3a3edef 100644 (file)
@@ -430,8 +430,8 @@ node_select_t make_node_select(void)
        node_select_t sel = {
                .automatic = OPTION_NONE,
                .focused = OPTION_NONE,
-               .local = OPTION_NONE,
                .active = OPTION_NONE,
+               .local = OPTION_NONE,
                .leaf = OPTION_NONE,
                .window = OPTION_NONE,
                .tiled = OPTION_NONE,
@@ -459,6 +459,7 @@ desktop_select_t make_desktop_select(void)
        desktop_select_t sel = {
                .occupied = OPTION_NONE,
                .focused = OPTION_NONE,
+               .active = OPTION_NONE,
                .urgent = OPTION_NONE,
                .local = OPTION_NONE
        };
@@ -984,12 +985,19 @@ bool node_matches(coordinates_t *loc, coordinates_t *ref, node_select_t *sel)
        }
 
        if (sel->focused != OPTION_NONE &&
-           loc->node != loc->desktop->focus
+           loc->node != mon->desk->focus
            ? sel->focused == OPTION_TRUE
            : sel->focused == OPTION_FALSE) {
                return false;
        }
 
+       if (sel->active != OPTION_NONE &&
+           loc->node != loc->desktop->focus
+           ? sel->active == OPTION_TRUE
+           : sel->active == OPTION_FALSE) {
+               return false;
+       }
+
        if (sel->automatic != OPTION_NONE &&
            loc->node->presel != NULL
            ? sel->automatic == OPTION_TRUE
@@ -1122,12 +1130,19 @@ bool desktop_matches(coordinates_t *loc, coordinates_t *ref, desktop_select_t *s
        }
 
        if (sel->focused != OPTION_NONE &&
-           loc->desktop != loc->monitor->desk
+           loc->desktop != mon->desk
            ? sel->focused == OPTION_TRUE
            : sel->focused == OPTION_FALSE) {
                return false;
        }
 
+       if (sel->active != OPTION_NONE &&
+           loc->desktop != loc->monitor->desk
+           ? sel->active == OPTION_TRUE
+           : sel->active == OPTION_FALSE) {
+               return false;
+       }
+
        if (sel->urgent != OPTION_NONE &&
            !is_urgent(loc->desktop)
            ? sel->urgent == OPTION_TRUE
@@ -1155,7 +1170,7 @@ bool monitor_matches(coordinates_t *loc, __attribute__((unused)) coordinates_t *
        }
 
        if (sel->focused != OPTION_NONE &&
-           mon != loc->monitor
+           loc->monitor != mon
            ? sel->focused == OPTION_TRUE
            : sel->focused == OPTION_FALSE) {
                return false;
index 26c0b755057982b5a0d472a588085fd68172f477..2dd188aae1c2504b2553f2a93d85c12aa6411c70 100644 (file)
@@ -163,8 +163,8 @@ typedef enum {
 typedef struct {
        option_bool_t automatic;
        option_bool_t focused;
-       option_bool_t local;
        option_bool_t active;
+       option_bool_t local;
        option_bool_t leaf;
        option_bool_t window;
        option_bool_t tiled;
@@ -188,6 +188,7 @@ typedef struct {
 typedef struct {
        option_bool_t occupied;
        option_bool_t focused;
+       option_bool_t active;
        option_bool_t urgent;
        option_bool_t local;
 } desktop_select_t;