[wiki] [sites] [dwm][patch][selectivefakefullscreen] Fix for resize issue || Francisco Tapia

From: <git_AT_suckless.org>
Date: Tue, 01 Dec 2020 20:45:12 +0100

commit 62c471348afd29d164cc4abcae050b7f883d0fd9
Author: Francisco Tapia <link_1232_AT_yahoo.com.mx>
Date: Tue Dec 1 13:44:54 2020 -0600

    [dwm][patch][selectivefakefullscreen] Fix for resize issue

diff --git a/dwm.suckless.org/patches/selectivefakefullscreen/dwm-selectivefakefullscreen-20201130-97099e7.diff b/dwm.suckless.org/patches/selectivefakefullscreen/dwm-selectivefakefullscreen-20201130-97099e7.diff
new file mode 100644
index 00000000..633775a7
--- /dev/null
+++ b/dwm.suckless.org/patches/selectivefakefullscreen/dwm-selectivefakefullscreen-20201130-97099e7.diff
_AT_@ -0,0 +1,145 @@
+From 7b7230cba4a3b886aa4239edecb86665dffcd9d8 Mon Sep 17 00:00:00 2001
+From: Francisco Tapia <link_1232_AT_yahoo.com.mx>
+Date: Mon, 30 Nov 2020 12:43:18 -0600
+Subject: [PATCH] Fix for selectivefakefullscreen resize issue
+
+Fixed a problem where entering a fake full screen caused the client
+to resize incorrectly, resulting in a truncated window, and
+requiring the user to force a whole screen update, e.g. toggling
+on and off the bar, to correctly draw the whole window.
+---
+ config.def.h | 6 +++---
+ dwm.c | 30 +++++++++++++++++++++++-------
+ 2 files changed, 26 insertions(+), 10 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..b7a445b 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -26,9 +26,9 @@ static const Rule rules[] = {
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, 1, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
++ /* class instance title tags mask isfloating isfakefullscreen monitor */
++ { "Gimp", NULL, NULL, 0, 1, 0, -1 },
++ { "Firefox", NULL, NULL, 1 << 8, 0, 1, -1 },
+ };
+
+ /* layout(s) */
+diff --git a/dwm.c b/dwm.c
+index 664c527..a7418aa 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -92,7 +92,7 @@ struct Client {
+ int basew, baseh, incw, inch, maxw, maxh, minw, minh;
+ int bw, oldbw;
+ unsigned int tags;
+- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, isfakefullscreen;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+_AT_@ -138,6 +138,7 @@ typedef struct {
+ const char *title;
+ unsigned int tags;
+ int isfloating;
++ int isfakefullscreen;
+ int monitor;
+ } Rule;
+
+_AT_@ -299,6 +300,7 @@ applyrules(Client *c)
+ && (!r->instance || strstr(instance, r->instance)))
+ {
+ c->isfloating = r->isfloating;
++ c->isfakefullscreen = r->isfakefullscreen;
+ c->tags |= r->tags;
+ for (m = mons; m && m->num != r->monitor; m = m->next);
+ if (m)
+_AT_@ -522,7 +524,8 @@ 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 */ && !c->isfullscreen)));
++ || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */
++ && (!c->isfullscreen || c->isfakefullscreen))));
+ } else if (cme->message_type == netatom[NetActiveWindow]) {
+ if (c != selmon->sel && !c->isurgent)
+ seturgent(c, 1);
+_AT_@ -566,7 +569,8 @@ configurenotify(XEvent *e)
+ updatebars();
+ for (m = mons; m; m = m->next) {
+ for (c = m->clients; c; c = c->next)
+- if (c->isfullscreen)
++ if (c->isfullscreen
++ && !c->isfakefullscreen)
+ resizeclient(c, m->mx, m->my, m->mw, m->mh);
+ XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
+ }
+_AT_@ -1144,7 +1148,8 @@ movemouse(const Arg *arg)
+
+ if (!(c = selmon->sel))
+ return;
+- if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
++ if (c->isfullscreen
++ && !c->isfakefullscreen) /* no support moving fullscreen windows by mouse */
+ return;
+ restack(selmon);
+ ocx = c->x;
+_AT_@ -1299,7 +1304,8 @@ resizemouse(const Arg *arg)
+
+ if (!(c = selmon->sel))
+ return;
+- if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
++ if (c->isfullscreen
++ && !c->isfakefullscreen) /* no support resizing fullscreen windows by mouse */
+ return;
+ restack(selmon);
+ ocx = c->x;
+_AT_@ -1477,6 +1483,10 @@ setfullscreen(Client *c, int fullscreen)
+ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
+ c->isfullscreen = 1;
++ if (c->isfakefullscreen) {
++ resizeclient(c, c->x, c->y, c->w, c->h);
++ return;
++ }
+ c->oldstate = c->isfloating;
+ c->oldbw = c->bw;
+ c->bw = 0;
+_AT_@ -1487,6 +1497,10 @@ setfullscreen(Client *c, int fullscreen)
+ XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
+ PropModeReplace, (unsigned char*)0, 0);
+ c->isfullscreen = 0;
++ if (c->isfakefullscreen) {
++ resizeclient(c, c->x, c->y, c->w, c->h);
++ return;
++ }
+ c->isfloating = c->oldstate;
+ c->bw = c->oldbw;
+ c->x = c->oldx;
+_AT_@ -1619,7 +1633,8 @@ 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) && !c->isfullscreen)
++ if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating)
++ && (!c->isfullscreen || c->isfakefullscreen))
+ resize(c, c->x, c->y, c->w, c->h, 0);
+ showhide(c->snext);
+ } else {
+_AT_@ -1713,7 +1728,8 @@ togglefloating(const Arg *arg)
+ {
+ if (!selmon->sel)
+ return;
+- if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
++ if (selmon->sel->isfullscreen
++ && !selmon->sel->isfakefullscreen) /* no support for fullscreen windows */
+ return;
+ selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
+ if (selmon->sel->isfloating)
+--
+2.20.1
+
diff --git a/dwm.suckless.org/patches/selectivefakefullscreen/index.md b/dwm.suckless.org/patches/selectivefakefullscreen/index.md
index 153cddb6..321ff4cc 100644
--- a/dwm.suckless.org/patches/selectivefakefullscreen/index.md
+++ b/dwm.suckless.org/patches/selectivefakefullscreen/index.md
_AT_@ -12,8 +12,17 @@ fake a full screen.
 
 Download
 --------
+* [dwm-selectivefakefullscreen-20201130-97099e7.diff](dwm-selectivefakefullscreen-20201130-97099e7.diff)
 * [dwm-selectivefakefullscreen-20200513-f09418b.diff](dwm-selectivefakefullscreen-20200513-f09418b.diff)
 
+Changelog
+---------
+2020-11-30:
+* Fix for resize issue
+
+2020-05-13:
+* Original patch
+
 Author
 ------
 * Francisco Javier Tapia - <link_1232_AT_yahoo.com.mx>
Received on Tue Dec 01 2020 - 20:45:12 CET

This archive was generated by hypermail 2.3.0 : Tue Dec 01 2020 - 20:48:43 CET