]> git.lizzy.rs Git - bspwm.git/commitdiff
New setting: `auto_alternate`
authorBastien Dejean <nihilhill@gmail.com>
Fri, 22 Mar 2013 18:17:03 +0000 (19:17 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 22 Mar 2013 18:17:03 +0000 (19:17 +0100)
README.md
bspwm.1
messages.c
settings.c
settings.h

index 65aa52a22a58eb2d9a7a6f9b9473f86e925d1ccf..53fe4b7486f283857871db07eafa52ce74b8eef6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -217,6 +217,8 @@ Colors are either [X color names](http://en.wikipedia.org/wiki/X11_color_names)
 
 - `apply_shadow_property` — Enable shadows for floating windows via the `_COMPTON_SHADOW` property.
 
+- `auto_alternate` — Whether to interpret two consecutive identical `use` messages as an `alternate` message.
+
 ## Environment Variables
 
 - `BSPWM_SOCKET` — The path of the socket used for the communication between `bspc` and `bspwm`.
diff --git a/bspwm.1 b/bspwm.1
index 09c2e600c5992fa16c191b89866f05a70cbf158e..f97776df213f293a44d4f39f9ce59f0c260556da 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -325,6 +325,13 @@ Prevent floating windows from being raised when they might cover other floating
 Enable shadows for floating windows via the
 .B _COMPTON_SHADOW
 property.
+.TP
+.I auto_alernate
+Whether to interpret two consecutive identical
+.B use
+messages as an
+.B alternate
+message.
 .SH ENVIRONMENT VARIABLES
 .TP
 .I BSPWM_SOCKET
index 73ee982cf29325828547d16f9041d21f5d4eb47e..cbfdfa1985a42bf5e232bb38eebc2c08acd70fe6 100644 (file)
@@ -294,7 +294,7 @@ void process_message(char *msg, char *rsp)
         if (name != NULL) {
             desktop_location_t loc;
             if (locate_desktop(name, &loc)) {
-                if (loc.desktop == mon->desk) {
+                if (auto_alternate && loc.desktop == mon->desk) {
                     select_desktop(mon->last_desk);
                 } else {
                     select_monitor(loc.monitor);
@@ -513,6 +513,10 @@ void set_setting(char *name, char *value, char *rsp)
         bool b;
         if (parse_bool(value, &b))
             apply_shadow_property = b;
+    } else if (strcmp(name, "auto_alternate") == 0) {
+        bool b;
+        if (parse_bool(value, &b))
+            auto_alternate = b;
     } else if (strcmp(name, "wm_name") == 0) {
         strncpy(wm_name, value, sizeof(wm_name));
         ewmh_update_wm_name();
@@ -568,6 +572,8 @@ void get_setting(char *name, char* rsp)
         snprintf(rsp, BUFSIZ, "%s", BOOLSTR(adaptative_raise));
     else if (strcmp(name, "apply_shadow_property") == 0)
         snprintf(rsp, BUFSIZ, "%s", BOOLSTR(apply_shadow_property));
+    else if (strcmp(name, "auto_alternate") == 0)
+        snprintf(rsp, BUFSIZ, "%s", BOOLSTR(auto_alternate));
     else if (strcmp(name, "wm_name") == 0)
         snprintf(rsp, BUFSIZ, "%s", wm_name);
     else
index d6dcdec993420e6dc58ab5b9efc8dd82634e0b52..2f1d96ae6370e62d943845c20e7a21d3cf195c1b 100644 (file)
@@ -64,4 +64,5 @@ void load_settings(void)
     focus_follows_pointer = FOCUS_FOLLOWS_POINTER;
     adaptative_raise = ADAPTATIVE_RAISE;
     apply_shadow_property = APPLY_SHADOW_PROPERTY;
+    auto_alternate = AUTO_ALTERNATE;
 }
index 4ed1ec0be4d303b085ffc767da363643b95b374a..30482e2355da9f53ea8a87d22f498dcfa42da83b 100644 (file)
@@ -25,6 +25,7 @@
 #define FOCUS_FOLLOWS_POINTER  false
 #define ADAPTATIVE_RAISE       false
 #define APPLY_SHADOW_PROPERTY  false
+#define AUTO_ALTERNATE         false
 
 char focused_border_color[MAXLEN];
 char active_border_color[MAXLEN];
@@ -52,6 +53,7 @@ bool gapless_monocle;
 bool focus_follows_pointer;
 bool adaptative_raise;
 bool apply_shadow_property;
+bool auto_alternate;
 
 char wm_name[MAXLEN];