]> git.lizzy.rs Git - bspwm.git/blobdiff - messages.c
Update debugging instructions
[bspwm.git] / messages.c
index e891618cf4e81793b27568bcc4093eca678b587c..e9bf052d28c2871b4532e1b8d197bed629738d8c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012-2014, Bastien Dejean
+/* Copyright (c) 2012, Bastien Dejean
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those
- * of the authors and should not be interpreted as representing official policies,
- * either expressed or implied, of the FreeBSD Project.
  */
 
 #include <errno.h>
@@ -962,6 +958,13 @@ int set_setting(coordinates_t loc, char *name, char *value)
        SETCOLOR(normal_private_border_color)
        SETCOLOR(urgent_border_color)
 #undef SETCOLOR
+       } else if (streq("initial_polarity", name)) {
+               child_polarity_t p;
+               if (parse_child_polarity(value, &p)) {
+                       initial_polarity = p;
+               } else {
+                       return MSG_FAILURE;
+               }
        } else if (streq("focus_follows_pointer", name)) {
                bool b;
                if (parse_bool(value, &b) && b != focus_follows_pointer) {
@@ -991,16 +994,26 @@ int set_setting(coordinates_t loc, char *name, char *value)
                        return MSG_FAILURE;
                SETBOOL(borderless_monocle)
                SETBOOL(gapless_monocle)
+               SETBOOL(pointer_follows_focus)
                SETBOOL(pointer_follows_monitor)
                SETBOOL(apply_floating_atom)
                SETBOOL(auto_alternate)
                SETBOOL(auto_cancel)
                SETBOOL(history_aware_focus)
+               SETBOOL(focus_by_distance)
                SETBOOL(ignore_ewmh_focus)
-               SETBOOL(remove_disabled_monitors)
-               SETBOOL(remove_unplugged_monitors)
-               SETBOOL(merge_overlapping_monitors)
+               SETBOOL(center_pseudo_tiled)
 #undef SETBOOL
+#define SETMONBOOL(s) \
+       } else if (streq(#s, name)) { \
+               if (!parse_bool(value, &s)) \
+                       return MSG_FAILURE; \
+               if (s) \
+                       update_monitors();
+               SETMONBOOL(remove_disabled_monitors)
+               SETMONBOOL(remove_unplugged_monitors)
+               SETMONBOOL(merge_overlapping_monitors)
+#undef SETMONBOOL
        } else {
                return MSG_FAILURE;
        }
@@ -1032,6 +1045,8 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
                fprintf(rsp, "%s", external_rules_command);
        else if (streq("status_prefix", name))
                fprintf(rsp, "%s", status_prefix);
+       else if (streq("initial_polarity", name))
+               fprintf(rsp, "%s", initial_polarity == FIRST_CHILD ? "first_child" : "second_child");
 #define MONDESKGET(k) \
        else if (streq(#k, name)) \
                if (loc.desktop != NULL) \
@@ -1066,12 +1081,15 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
        GETBOOL(borderless_monocle)
        GETBOOL(gapless_monocle)
        GETBOOL(focus_follows_pointer)
+       GETBOOL(pointer_follows_focus)
        GETBOOL(pointer_follows_monitor)
        GETBOOL(apply_floating_atom)
        GETBOOL(auto_alternate)
        GETBOOL(auto_cancel)
        GETBOOL(history_aware_focus)
+       GETBOOL(focus_by_distance)
        GETBOOL(ignore_ewmh_focus)
+       GETBOOL(center_pseudo_tiled)
        GETBOOL(remove_disabled_monitors)
        GETBOOL(remove_unplugged_monitors)
        GETBOOL(merge_overlapping_monitors)
@@ -1190,6 +1208,18 @@ bool parse_pointer_action(char *s, pointer_action_t *a)
        return false;
 }
 
+bool parse_child_polarity(char *s, child_polarity_t *p)
+{
+       if (streq("first_child", s)) {
+               *p = FIRST_CHILD;
+               return true;
+       } else if (streq("second_child", s)) {
+               *p = SECOND_CHILD;
+               return true;
+       }
+       return false;
+}
+
 bool parse_degree(char *s, int *d)
 {
        int i = atoi(s);