Implement fixture #63 : auto center option for free client
This commit is contained in:
parent
c317afc79d
commit
2320e8586c
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user