Skip to content

Commit 4923e3e

Browse files
Force Tag Layout patch
1 parent 8ed5108 commit 4923e3e

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

config.def.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,10 @@ static const Layout layouts[] = {
135135
{ NULL, NULL },
136136
};
137137

138-
// static const MonitorRule monrules[] = {
139-
// /* monitor tag layout mfact nmaster showbar topbar */
140-
// { 0, 0, 6, -1, -1, -1, -1 }, // use a different layout for the second monitor
141-
// { -1, -1, 0, -1, -1, -1, -1 }, // default
142-
// };
138+
static const Taglayout taglayouts[] = {
139+
/* tag layout */
140+
{ 1, {.v = &layouts[6]} },
141+
};
143142

144143
/* key definitions */
145144
#define MODKEY Mod4Mask

instawm.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ typedef struct {
182182
int monitor;
183183
} Rule;
184184

185+
typedef struct {
186+
int tag;
187+
const Arg arg;
188+
} Taglayout;
189+
185190
typedef struct Systray Systray;
186191
struct Systray {
187192
Window win;
@@ -356,12 +361,12 @@ static xcb_connection_t *xcon;
356361
#include "config.h"
357362

358363
struct Pertag {
359-
unsigned int curtag, prevtag; /* current and previous tag */
360-
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
361-
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
362-
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
363-
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
364-
int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
364+
unsigned int curtag, prevtag; /* current and previous tag */
365+
int nmasters[LENGTH(tags) + 1]; /* number of windows in master area */
366+
float mfacts[LENGTH(tags) + 1]; /* mfacts per tag */
367+
unsigned int sellts[LENGTH(tags) + 1]; /* selected layouts */
368+
const Layout *ltidxs[LENGTH(tags) + 1][2]; /* matrix of tags and layouts indexes */
369+
int showbars[LENGTH(tags) + 1]; /* display bar for the current tag */
365370
};
366371

367372
static unsigned int scratchtag = 1 << LENGTH(tags);
@@ -2904,6 +2909,9 @@ view(const Arg *arg)
29042909

29052910
focus(NULL);
29062911
arrange(selmon);
2912+
for (int i = 0; i < LENGTH(taglayouts); i++)
2913+
if (arg->ui & 1 << (taglayouts[i].tag - 1))
2914+
setlayout(&taglayouts[i].arg);
29072915
}
29082916

29092917
pid_t

0 commit comments

Comments
 (0)