Minor refactoring of warp and fullscreen patches, getting rid of MONOCLE_LAYOUT_POS setting

This commit is contained in:
bakkeby
2020-08-27 06:26:48 +02:00
parent f45acf8795
commit e952cc9a81
5 changed files with 31 additions and 17 deletions

View File

@@ -3,9 +3,11 @@ Layout *last_layout;
void
fullscreen(const Arg *arg)
{
int monocle_pos;
if (selmon->showbar || last_layout == NULL) {
for (monocle_pos = 0, last_layout = (Layout *)layouts; !last_layout->arrange || last_layout->arrange != &monocle; monocle_pos++, last_layout++ );
for (last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
setlayout(&((Arg) { .v = &layouts[MONOCLE_LAYOUT_POS] }));
setlayout(&((Arg) { .v = &layouts[monocle_pos] }));
} else {
setlayout(&((Arg) { .v = last_layout }));
}