X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/f8e2a655036a3f2e45d01b9121837270998b240b..35d1c1e9bb97f8721064444275c57cfb8b863e48:/dwm.c diff --git a/dwm.c b/dwm.c index 5b0c792..fb1c33f 100644 --- a/dwm.c +++ b/dwm.c @@ -212,6 +212,7 @@ static void sendmon(Client *c, Monitor *m); static void setclientstate(Client *c, long state); static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); +static void fullscreen(const Arg *arg); static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setup(void); @@ -1584,6 +1585,19 @@ setfullscreen(Client *c, int fullscreen) } } +Layout *last_layout; +void +fullscreen(const Arg *arg) +{ + if (selmon->showbar) { + for(last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++); + setlayout(&((Arg) { .v = &layouts[2] })); + } else { + setlayout(&((Arg) { .v = last_layout })); + } + togglebar(arg); +} + void setlayout(const Arg *arg) {