diff --git a/src/client.c b/src/client.c index 1090d2b..9574620 100644 --- a/src/client.c +++ b/src/client.c @@ -432,7 +432,7 @@ client_manage(Window w, XWindowAttributes *wa) * \param r Bool for resize hint or not */ void -client_moveresize(Client *c, XRectangle geo, bool r) +client_moveresize(Client *c, XRectangle geo, Bool r) { if(!c || c->state_dock) return; @@ -511,12 +511,11 @@ client_moveresize(Client *c, XRectangle geo, bool r) void client_maximize(Client *c) { - CHECK(c); - XRectangle geo; + CHECK(c); - client_raise(c); + client_focus(c); c->screen = screen_get_with_geo(c->geo.x, c->geo.y); @@ -533,7 +532,6 @@ client_maximize(Client *c) client_moveresize(c, geo, False); - return; } diff --git a/src/ewmh.c b/src/ewmh.c index 70fa0bb..3e006b0 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -239,6 +239,7 @@ ewmh_manage_net_wm_state(long data_l[], Client *c) if(c->free) c->ogeo = c->geo; client_maximize(c); + client_raise(c); } else if(data_l[0] == _NET_WM_STATE_REMOVE && c->state_fullscreen) { diff --git a/src/layout.c b/src/layout.c index 31b1472..9388878 100644 --- a/src/layout.c +++ b/src/layout.c @@ -491,15 +491,19 @@ uicb_togglemax(uicb_t cmd) if(!sel->max) { - sel->tile = sel->free = False; + sel->ogeo = sel->geo; + sel->tile = False; client_maximize(sel); + client_raise(sel); sel->max = True; } - else if(sel->max) + else { sel->max = False; tags[selscreen][seltag[selscreen]].layout.func(); } + + return; } diff --git a/src/structs.h b/src/structs.h index 6a099c2..84f1f8d 100644 --- a/src/structs.h +++ b/src/structs.h @@ -48,6 +48,8 @@ typedef unsigned char uchar; /* Enum */ enum { CurNormal, CurResize, CurMove, CurLast }; +typedef enum { Top, Bottom, Right, Left, Center, PositionLast } Position; + /* Ewmh hints list */ enum { @@ -80,7 +82,6 @@ enum wmfs_current_layout, net_last }; -typedef enum { Top, Bottom, Right, Left, Center, PositionLast } Position; /* * BarWindow Structure @@ -201,9 +202,9 @@ typedef struct { /* Misc option */ char *font; - bool raisefocus; - bool raiseswitch; - bool bartop; + Bool raisefocus; + Bool raiseswitch; + Bool bartop; struct { /* @@ -247,7 +248,7 @@ typedef struct Alias alias[256]; Layout layout[NUM_OF_LAYOUT]; int *ntag; - bool tag_round; + Bool tag_round; int nkeybind; int nbutton; int nlayout; diff --git a/src/wmfs.h b/src/wmfs.h index 59963ec..cf03592 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -36,7 +36,6 @@ /* Lib headers */ #include #include -#include #include #include #include @@ -128,7 +127,7 @@ void client_kill(Client *c); Bool ishide(Client *c); void client_map(Client *c); void client_manage(Window w, XWindowAttributes *wa); -void client_moveresize(Client *c, XRectangle geo, bool r); +void client_moveresize(Client *c, XRectangle geo, Bool r); void client_maximize(Client *c); void client_size_hints(Client *c); void client_raise(Client *c);