X-Git-Url: https://git.xinqibao.xyz/dwm.git/blobdiff_plain/4a0af747c2f271592fa37474c993bd522a710e61..41a4e1809ca3051981f2f07219f1dcc8428ae657:/dwm.c?ds=sidebyside diff --git a/dwm.c b/dwm.c index 781e060..556d934 100644 --- a/dwm.c +++ b/dwm.c @@ -214,7 +214,6 @@ static void setclientstate(Client *c, long state); static void setfocus(Client *c); static void setfullscreen(Client *c, int fullscreen); static void setgaps(const Arg *arg); -static void fullscreen(const Arg *arg); static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setup(void); @@ -229,6 +228,7 @@ static void tagmon(const Arg *arg); static void tile(Monitor *); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); +static void togglefullscr(const Arg *arg); static void toggletag(const Arg *arg); static void toggleview(const Arg *arg); static void unfocus(Client *c, int setfocus); @@ -1592,19 +1592,6 @@ 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 setgaps(const Arg *arg) { @@ -1857,6 +1844,13 @@ togglefloating(const Arg *arg) arrange(selmon); } +void +togglefullscr(const Arg *arg) +{ + if(selmon->sel) + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); +} + void toggletag(const Arg *arg) {