diff --git a/src/client.c b/src/client.c index 7405558..3bc43e4 100644 --- a/src/client.c +++ b/src/client.c @@ -706,7 +706,16 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar) mx += spgeo[selscreen].x; my += spgeo[selscreen].y; } + + if(conf.client_auto_center) + { + XRectangle tmp; + tmp = screen_get_geo(selscreen); + mx = (tmp.width + mx - wa->width) / 2; + my = (tmp.height + my - wa->height) / 2; + } } + c->ogeo.x = c->geo.x = mx; c->ogeo.y = c->geo.y = my; c->ogeo.width = c->geo.width = wa->width; diff --git a/src/config.c b/src/config.c index f72d42d..7c7eb22 100644 --- a/src/config.c +++ b/src/config.c @@ -271,6 +271,7 @@ conf_client_section(void) sec = fetch_section_first(NULL, "client"); conf.client_round = fetch_opt_first(sec, "true", "client_round").bool; + conf.client_auto_center = fetch_opt_first(sec, "false", "client_auto_center").bool; if ((conf.client.borderheight = fetch_opt_first(sec, "1", "border_height").num) < 1) conf.client.borderheight = 1; diff --git a/src/structs.h b/src/structs.h index 55e7b33..004d86d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -484,6 +484,7 @@ typedef struct Bool tag_round; Bool tag_auto_prev; Bool client_round; + Bool client_auto_center; Bool layout_system; /* Switch: False, Menu: True. */ Bool layout_placement; /* Right (normal): False, Left: True. */ Bool keep_layout_geo; diff --git a/wmfsrc b/wmfsrc index ad8422d..cb2cf53 100644 --- a/wmfsrc +++ b/wmfsrc @@ -157,6 +157,7 @@ [client] client_round = true + client_auto_center = false border_height = 3 border_shadow = true border_normal = "#191919"