Implement fixture #63 : auto center option for free client

This commit is contained in:
Raphael Khaiat 2011-01-10 20:40:55 +01:00
parent c317afc79d
commit 2320e8586c
4 changed files with 12 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

1
wmfsrc
View File

@ -157,6 +157,7 @@
[client]
client_round = true
client_auto_center = false
border_height = 3
border_shadow = true
border_normal = "#191919"