mirror of
https://github.com/iritmaximus/dwl.git
synced 2026-10-12 19:13:43 +03:00
did something
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||
static const int smartborders = 1;
|
||||
static const int smartgaps = 0; /* 1 means no outer gap when there is only one window */
|
||||
static int gaps = 1; /* 1 means gaps between windows are added */
|
||||
static const unsigned int gappx = 10; /* gap pixel between windows */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const float rootcolor[] = COLOR(0x222222ff);
|
||||
static const float bordercolor[] = COLOR(0x444444ff);
|
||||
@@ -147,6 +150,7 @@ static const Key keys[] = {
|
||||
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
|
||||
{ MODKEY, XKB_KEY_Return, zoom, {0} },
|
||||
{ MODKEY, XKB_KEY_Tab, view, {0} },
|
||||
{ MODKEY, XKB_KEY_g, togglegaps, {0} },
|
||||
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
|
||||
{ MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
static const int sloppyfocus = 1; /* focus follows mouse */
|
||||
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
|
||||
static const int smartborders = 1;
|
||||
static const int smartgaps = 1; /* 1 means no outer gap when there is only one window */
|
||||
static int gaps = 1; /* 1 means gaps between windows are added */
|
||||
static const unsigned int gappx = 5; /* gap pixel between windows */
|
||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const float rootcolor[] = COLOR(0x222222ff);
|
||||
static const float bordercolor[] = COLOR(0x444444ff);
|
||||
|
||||
@@ -214,6 +214,7 @@ struct Monitor {
|
||||
struct wl_list layers[4]; /* LayerSurface.link */
|
||||
const Layout *lt[2];
|
||||
Pertag *pertag;
|
||||
int gaps;
|
||||
unsigned int seltags;
|
||||
unsigned int sellt;
|
||||
uint32_t tagset[2];
|
||||
@@ -364,6 +365,7 @@ static void toggledimmingclient(const Arg *arg);
|
||||
static void togglefloating(const Arg *arg);
|
||||
static void togglesticky(const Arg *arg);
|
||||
static void togglefullscreen(const Arg *arg);
|
||||
static void togglegaps(const Arg *arg);
|
||||
static void toggletag(const Arg *arg);
|
||||
static void toggleview(const Arg *arg);
|
||||
static void unlocksession(struct wl_listener *listener, void *data);
|
||||
@@ -1094,6 +1096,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||
|
||||
wlr_output_state_init(&state);
|
||||
/* Initialize monitor state using configured rules */
|
||||
m->gaps = gaps;
|
||||
|
||||
m->tagset[0] = m->tagset[1] = 1;
|
||||
for (r = monrules; r < END(monrules); r++) {
|
||||
if (!r->name || strstr(wlr_output->name, r->name)) {
|
||||
@@ -2979,7 +2983,7 @@ tagmon(const Arg *arg)
|
||||
void
|
||||
tile(Monitor *m)
|
||||
{
|
||||
unsigned int mw, my, ty, draw_borders = 1;
|
||||
unsigned int h, r, e = m->gaps, mw, my, ty, draw_borders = 1;
|
||||
int i, n = 0;
|
||||
Client *c;
|
||||
|
||||
@@ -2988,26 +2992,33 @@ tile(Monitor *m)
|
||||
n++;
|
||||
if (n == 0)
|
||||
return;
|
||||
if (smartgaps == n)
|
||||
e = 0;
|
||||
|
||||
if (n == smartborders)
|
||||
draw_borders = 0;
|
||||
|
||||
if (n > m->nmaster)
|
||||
mw = m->nmaster ? (int)roundf(m->w.width * m->mfact) : 0;
|
||||
mw = m->nmaster ? (int)roundf((m->w.width + gappx*e) * m->mfact) : 0;
|
||||
else
|
||||
mw = m->w.width;
|
||||
i = my = ty = 0;
|
||||
i = 0;
|
||||
my = ty = gappx*e;
|
||||
wl_list_for_each(c, &clients, link) {
|
||||
if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
|
||||
continue;
|
||||
if (i < m->nmaster) {
|
||||
resize(c, (struct wlr_box){.x = m->w.x, .y = m->w.y + my, .width = mw,
|
||||
.height = (m->w.height - my) / (MIN(n, m->nmaster) - i)}, 0, draw_borders);
|
||||
my += c->geom.height;
|
||||
r = MIN(n, m->nmaster) - i;
|
||||
h = (m->w.height - my - gappx*e - gappx*e * (r - 1)) / r;
|
||||
resize(c, (struct wlr_box){.x = m->w.x + gappx*e, .y = m->w.y + my,
|
||||
.width = mw - 2*gappx*e, .height = h}, 0, 1);
|
||||
my += c->geom.height + gappx*e;
|
||||
} else {
|
||||
r = n - i;
|
||||
h = (m->w.height - ty - gappx*e - gappx*e * (r - 1)) / r;
|
||||
resize(c, (struct wlr_box){.x = m->w.x + mw, .y = m->w.y + ty,
|
||||
.width = m->w.width - mw, .height = (m->w.height - ty) / (n - i)}, 0, draw_borders);
|
||||
ty += c->geom.height;
|
||||
.width = m->w.width - mw - gappx*e, .height = h}, 0, 1);
|
||||
ty += c->geom.height + gappx*e;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -3061,6 +3072,13 @@ togglesticky(const Arg *arg)
|
||||
setsticky(c, !c->issticky);
|
||||
}
|
||||
|
||||
void
|
||||
togglegaps(const Arg *arg)
|
||||
{
|
||||
selmon->gaps = !selmon->gaps;
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
void
|
||||
toggletag(const Arg *arg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user