diff options
| author | Mouad Alami <moadalami40@gmail.com> | 2023-08-07 12:24:16 +0100 |
|---|---|---|
| committer | Mouad Alami <moadalami40@gmail.com> | 2023-08-07 12:24:16 +0100 |
| commit | 941f42bb8cf70701cc247ea426444719e7606cb4 (patch) | |
| tree | 6853631d0ce24a7f71e5f72fdebe0e6a2e1fd00b | |
| parent | 9a59b1ec1aee0d49a1baaba2f27c1ca3ad1c8a0e (diff) | |
Revert "fakefullscreen patch"
This reverts commit 9a59b1ec1aee0d49a1baaba2f27c1ca3ad1c8a0e.
| -rw-r--r-- | README | 2 | ||||
| -rw-r--r-- | config.h | 2 | ||||
| -rw-r--r-- | dwm.c | 30 |
3 files changed, 29 insertions, 5 deletions
@@ -49,4 +49,4 @@ and (re)compiling the source code. Patches applied --------------- -zoomswap - scratchpad - sticky - statuscmd - pertag - noborder - movestack - hide vacant tags - actualfullscreen - bar height - alpha monocle layout - fakefullscreen +zoomswap - scratchpad - sticky - statuscmd - pertag - noborder - movestack - hide vacant tags - actualfullscreen - bar height - alpha monocle layout @@ -54,7 +54,7 @@ static const Rule rules[] = { static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ static const int nmaster = 1; /* number of clients in master area */ static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ -static const int lockfullscreen = 0; /* 1 will force focus on the fullscreen window */ +static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ static const Layout layouts[] = { /* symbol arrange function */ @@ -569,7 +569,7 @@ clientmessage(XEvent *e) if (cme->data.l[1] == netatom[NetWMFullscreen] || cme->data.l[2] == netatom[NetWMFullscreen]) setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ - || cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */)); + || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen))); if (cme->data.l[1] == netatom[NetWMSticky] || cme->data.l[2] == netatom[NetWMSticky]) @@ -603,7 +603,8 @@ void configurenotify(XEvent *e) { Monitor *m; - XConfigureEvent *ev = &e->xconfigure; + Client *c; + XConfigureEvent *ev = &e->xconfigure; int dirty; /* TODO: updategeom handling sucks, needs to be simplified */ @@ -615,6 +616,9 @@ configurenotify(XEvent *e) drw_resize(drw, sw, bh); updatebars(); for (m = mons; m; m = m->next) { + for (c = m->clients; c; c = c->next) + if (c->isfullscreen) + resizeclient(c, m->mx, m->my, m->mw, m->mh); XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); } focus(NULL); @@ -1280,6 +1284,8 @@ movemouse(const Arg *arg) if (!(c = selmon->sel)) return; + if (c->isfullscreen) /* no support moving fullscreen windows by mouse */ + return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1441,6 +1447,8 @@ resizemouse(const Arg *arg) if (!(c = selmon->sel)) return; + if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ + return; restack(selmon); ocx = c->x; ocy = c->y; @@ -1617,10 +1625,24 @@ setfullscreen(Client *c, int fullscreen) XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); c->isfullscreen = 1; + c->oldstate = c->isfloating; + c->oldbw = c->bw; + c->bw = 0; + c->isfloating = 1; + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); } else if (!fullscreen && c->isfullscreen){ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, PropModeReplace, (unsigned char*)0, 0); c->isfullscreen = 0; + c->isfloating = c->oldstate; + c->bw = c->oldbw; + c->x = c->oldx; + c->y = c->oldy; + c->w = c->oldw; + c->h = c->oldh; + resizeclient(c, c->x, c->y, c->w, c->h); + arrange(c->mon); } } @@ -1768,7 +1790,7 @@ showhide(Client *c) if (ISVISIBLE(c)) { /* show clients top down */ XMoveWindow(dpy, c->win, c->x, c->y); - if (!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) + if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) resize(c, c->x, c->y, c->w, c->h, 0); showhide(c->snext); } else { @@ -1875,6 +1897,8 @@ togglefloating(const Arg *arg) { if (!selmon->sel) return; + if (selmon->sel->isfullscreen) /* no support for fullscreen windows */ + return; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; if (selmon->sel->isfloating) resize(selmon->sel, selmon->sel->x, selmon->sel->y, |
