backports

This commit is contained in:
Dmitry Zakharchenko 2023-03-16 16:46:02 +02:00
parent 24529f7335
commit 87726760de
2 changed files with 10 additions and 3 deletions

View file

@ -9,7 +9,6 @@ static const unsigned int gappiv = 15;
static const unsigned int gappoh = 15;
static const unsigned int gappov = 15;
static const float rootcolor[] = {0.13, 0.13, 0.13, 1.0};
static const float bordercolor[] = {0.26, 0.26, 0.26, 1.0};
static const float focuscolor[] = {0.0, 0.33, 0.46, 1.0};
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};

12
dwl.c
View file

@ -202,6 +202,7 @@ struct Monitor {
unsigned int tagset[2];
double mfact;
int nmaster;
char ltsymbol[16];
};
typedef struct {
@ -553,7 +554,8 @@ arrange(Monitor *m)
wlr_scene_node_set_enabled(&m->fullscreen_bg->node,
(c = focustop(m)) && c->isfullscreen);
if (m)
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
if (m && m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
motionnotify(0);
@ -1062,6 +1064,7 @@ createmon(struct wl_listener *listener, void *data)
wlr_output_layout_add_auto(output_layout, wlr_output);
else
wlr_output_layout_add(output_layout, wlr_output, m->m.x, m->m.y);
strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, LENGTH(m->ltsymbol));
}
void
@ -1788,12 +1791,16 @@ void
monocle(Monitor *m)
{
Client *c;
int n = 0;
wl_list_for_each(c, &clients, link) {
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue;
resize(c, m->w, 0);
n++;
}
if (n)
snprintf(m->ltsymbol, LENGTH(m->ltsymbol), "[%d]", n);
if ((c = focustop(m)))
wlr_scene_node_raise_to_top(&c->scene->node);
}
@ -2081,7 +2088,7 @@ printstatus(void)
printf("%s selmon %u\n", m->wlr_output->name, m == selmon);
printf("%s tags %u %u %u %u\n", m->wlr_output->name, occ, m->tagset[m->seltags],
sel, urg);
printf("%s layout %s\n", m->wlr_output->name, m->lt[m->sellt]->symbol);
printf("%s layout %s\n", m->wlr_output->name, m->ltsymbol);
}
fflush(stdout);
}
@ -2287,6 +2294,7 @@ setlayout(const Arg *arg)
if (arg && arg->v)
selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v;
/* TODO change layout symbol? */
strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol));
arrange(selmon);
printstatus();
}