]> git.lizzy.rs Git - bspwm.git/blobdiff - tree.c
Reinstate the motion recorder for FFP
[bspwm.git] / tree.c
diff --git a/tree.c b/tree.c
index c428a40a6580d8f663d22635f27496e08b95a3d6..206dcf1ff57bd414406d91785a4c9646a3814ba7 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -30,6 +30,7 @@
 #include "history.h"
 #include "monitor.h"
 #include "query.h"
+#include "subscribe.h"
 #include "settings.h"
 #include "stack.h"
 #include "window.h"
@@ -76,8 +77,13 @@ void apply_layout(monitor_t *m, desktop_t *d, node_t *n, xcb_rectangle_t rect, x
                                if (n->client->pseudo_tiled) {
                                /* pseudo-tiled clients */
                                        r = n->client->floating_rectangle;
-                                       r.x = rect.x - bw + (rect.width - wg - r.width) / 2;
-                                       r.y = rect.y - bw + (rect.height - wg - r.height) / 2;
+                                       if (center_pseudo_tiled) {
+                                               r.x = rect.x - bw + (rect.width - wg - r.width) / 2;
+                                               r.y = rect.y - bw + (rect.height - wg - r.height) / 2;
+                                       } else {
+                                               r.x = rect.x;
+                                               r.y = rect.y;
+                                       }
                                } else {
                                        /* tiled clients */
                                        r = rect;
@@ -148,12 +154,7 @@ void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
        } else {
                node_t *c = make_node();
                node_t *p = f->parent;
-               if (p != NULL && f->split_mode == MODE_AUTOMATIC &&
-                   (p->first_child->vacant || p->second_child->vacant)) {
-                       f = p;
-                       p = f->parent;
-               }
-               if (((f->client != NULL && f->client->private) ||
+               if ((f->client->private ||
                     (p != NULL && p->privacy_level > 0)) &&
                    f->split_mode == MODE_AUTOMATIC) {
                        node_t *closest = NULL;
@@ -176,6 +177,11 @@ void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                                }
                        }
                }
+               if (p != NULL && f->split_mode == MODE_AUTOMATIC &&
+                   (p->first_child->vacant || p->second_child->vacant)) {
+                       f = p;
+                       p = f->parent;
+               }
                n->parent = c;
                c->birth_rotation = f->birth_rotation;
                switch (f->split_mode) {
@@ -272,7 +278,7 @@ void insert_node(monitor_t *m, desktop_t *d, node_t *n, node_t *f)
                d->focus = n;
        if (n->client->sticky)
                m->num_sticky++;
-       put_status();
+       put_status(SBSC_MASK_REPORT);
 }
 
 void pseudo_focus(monitor_t *m, desktop_t *d, node_t *n)
@@ -313,7 +319,7 @@ void focus_node(monitor_t *m, desktop_t *d, node_t *n)
                }
                if (n->client->urgent) {
                        n->client->urgent = false;
-                       put_status();
+                       put_status(SBSC_MASK_REPORT);
                }
        }
 
@@ -352,10 +358,11 @@ void focus_node(monitor_t *m, desktop_t *d, node_t *n)
        if (focus_follows_pointer) {
                xcb_window_t win = XCB_NONE;
                query_pointer(&win, NULL);
-               if (win != n->client->window)
+               if (win != n->client->window) {
                        enable_motion_recorder();
-               else
+               } else {
                        disable_motion_recorder();
+               }
        }
 
        if (pointer_follows_focus) {
@@ -926,7 +933,7 @@ void unlink_node(monitor_t *m, desktop_t *d, node_t *n)
        }
        if (n->client->sticky)
                m->num_sticky--;
-       put_status();
+       put_status(SBSC_MASK_REPORT);
 }
 
 void remove_node(monitor_t *m, desktop_t *d, node_t *n)