Remove maximize function

Resizing fullscreen windows in tile and monocle is useless
This commit is contained in:
Stivvo 2021-02-10 23:41:37 +01:00
parent 09da42e668
commit 13b853d96a

25
dwl.c
View File

@ -248,7 +248,6 @@ static void keypressmod(struct wl_listener *listener, void *data);
static void killclient(const Arg *arg); static void killclient(const Arg *arg);
static void maplayersurfacenotify(struct wl_listener *listener, void *data); static void maplayersurfacenotify(struct wl_listener *listener, void *data);
static void mapnotify(struct wl_listener *listener, void *data); static void mapnotify(struct wl_listener *listener, void *data);
static void maximizeclient(Client *c);
static void monocle(Monitor *m); static void monocle(Monitor *m);
static void motionabsolute(struct wl_listener *listener, void *data); static void motionabsolute(struct wl_listener *listener, void *data);
static void motionnotify(uint32_t time); static void motionnotify(uint32_t time);
@ -483,8 +482,6 @@ arrange(Monitor *m)
{ {
if (m->lt[m->sellt]->arrange) if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m); m->lt[m->sellt]->arrange(m);
else if (m->focus && m->focus->isfullscreen)
maximizeclient(m->focus);
/* TODO recheck pointer focus here... or in resize()? */ /* TODO recheck pointer focus here... or in resize()? */
} }
@ -1040,13 +1037,6 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen); setfullscreen(sel, !sel->isfullscreen);
} }
void
maximizeclient(Client *c)
{
resize(c, c->mon->m.x, c->mon->m.y, c->mon->m.width, c->mon->m.height, 0);
/* used for fullscreen clients */
}
void void
setfullscreen(Client *c, int fullscreen) setfullscreen(Client *c, int fullscreen)
{ {
@ -1059,7 +1049,7 @@ setfullscreen(Client *c, int fullscreen)
c->prevy = c->geom.y; c->prevy = c->geom.y;
c->prevheight = c->geom.height; c->prevheight = c->geom.height;
c->prevwidth = c->geom.width; c->prevwidth = c->geom.width;
maximizeclient(c); resize(c, c->mon->m.x, c->mon->m.y, c->mon->m.width, c->mon->m.height, 0);
} else { } else {
/* restore previous size instead of arrange for floating windows since /* restore previous size instead of arrange for floating windows since
* client positions are set by the user and cannot be recalculated */ * client positions are set by the user and cannot be recalculated */
@ -1356,12 +1346,9 @@ monocle(Monitor *m)
Client *c; Client *c;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (!VISIBLEON(c, m) || c->isfloating) if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue; continue;
if (c->isfullscreen) resize(c, m->w.x, m->w.y, m->w.width, m->w.height, 0);
maximizeclient(c);
else
resize(c, m->w.x, m->w.y, m->w.width, m->w.height, 0);
} }
} }
@ -2179,12 +2166,8 @@ tile(Monitor *m)
mw = m->w.width; mw = m->w.width;
i = my = ty = 0; i = my = ty = 0;
wl_list_for_each(c, &clients, link) { wl_list_for_each(c, &clients, link) {
if (!VISIBLEON(c, m) || c->isfloating) if (!VISIBLEON(c, m) || c->isfloating || c->isfullscreen)
continue; continue;
if (c->isfullscreen) {
maximizeclient(c);
continue;
}
if (i < m->nmaster) { if (i < m->nmaster) {
h = (m->w.height - my) / (MIN(n, m->nmaster) - i); h = (m->w.height - my) / (MIN(n, m->nmaster) - i);
resize(c, m->w.x, m->w.y + my, mw, h, 0); resize(c, m->w.x, m->w.y + my, mw, h, 0);