]> git.lizzy.rs Git - bspwm.git/blobdiff - window.c
New setting: persistent_monitors
[bspwm.git] / window.c
index c5bef745ebbb4bcf242769c5d9140315f0891474..ce69617ed9e2fcaf028d74daa6a1b75db9d86386 100644 (file)
--- a/window.c
+++ b/window.c
@@ -122,8 +122,10 @@ void manage_window(xcb_window_t win, rule_consequence_t *csq, int fd)
                }
        }
 
-       client_t *c = make_client(win);
+       client_t *c = make_client(win, d->border_width);
        update_floating_rectangle(c);
+       if (c->floating_rectangle.x == 0 && c->floating_rectangle.y == 0)
+               csq->center = true;
        c->min_width = csq->min_width;
        c->max_width = csq->max_width;
        c->min_height = csq->min_height;
@@ -648,6 +650,8 @@ void window_center(monitor_t *m, client_t *c)
                r->y = a.y;
        else
                r->y = a.y + (a.height - r->height) / 2;
+       r->x -= c->border_width;
+       r->y -= c->border_width;
 }
 
 void window_stack(xcb_window_t w1, xcb_window_t w2, uint32_t mode)