sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-fakefullscreen-20210714-138b405.diff (4061B)


      1 From 33c7811ca7280be7890851f5a83fa8d1a3313374 Mon Sep 17 00:00:00 2001
      2 From: Sebastian LaVine <mail@smlavine.com>
      3 Date: Wed, 14 Jul 2021 11:22:34 -0400
      4 Subject: [PATCH] Set new lockfullscreen variable to 0
      5 
      6 This more properly fixes the problem introduced by 67d76bd than the
      7 previous patch revision does.
      8 ---
      9  config.def.h |  2 +-
     10  dwm.c        | 28 ++--------------------------
     11  2 files changed, 3 insertions(+), 27 deletions(-)
     12 
     13 diff --git a/config.def.h b/config.def.h
     14 index a2ac963..1b46cb4 100644
     15 --- a/config.def.h
     16 +++ b/config.def.h
     17 @@ -35,7 +35,7 @@ static const Rule rules[] = {
     18  static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
     19  static const int nmaster     = 1;    /* number of clients in master area */
     20  static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
     21 -static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
     22 +static const int lockfullscreen = 0; /* 1 will force focus on the fullscreen window */
     23  
     24  static const Layout layouts[] = {
     25  	/* symbol     arrange function */
     26 diff --git a/dwm.c b/dwm.c
     27 index 5e4d494..968e256 100644
     28 --- a/dwm.c
     29 +++ b/dwm.c
     30 @@ -522,7 +522,7 @@ clientmessage(XEvent *e)
     31  		if (cme->data.l[1] == netatom[NetWMFullscreen]
     32  		|| cme->data.l[2] == netatom[NetWMFullscreen])
     33  			setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD    */
     34 -				|| (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
     35 +				|| cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */));
     36  	} else if (cme->message_type == netatom[NetActiveWindow]) {
     37  		if (c != selmon->sel && !c->isurgent)
     38  			seturgent(c, 1);
     39 @@ -552,7 +552,6 @@ void
     40  configurenotify(XEvent *e)
     41  {
     42  	Monitor *m;
     43 -	Client *c;
     44  	XConfigureEvent *ev = &e->xconfigure;
     45  	int dirty;
     46  
     47 @@ -565,9 +564,6 @@ configurenotify(XEvent *e)
     48  			drw_resize(drw, sw, bh);
     49  			updatebars();
     50  			for (m = mons; m; m = m->next) {
     51 -				for (c = m->clients; c; c = c->next)
     52 -					if (c->isfullscreen)
     53 -						resizeclient(c, m->mx, m->my, m->mw, m->mh);
     54  				XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
     55  			}
     56  			focus(NULL);
     57 @@ -1144,8 +1140,6 @@ movemouse(const Arg *arg)
     58  
     59  	if (!(c = selmon->sel))
     60  		return;
     61 -	if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
     62 -		return;
     63  	restack(selmon);
     64  	ocx = c->x;
     65  	ocy = c->y;
     66 @@ -1299,8 +1293,6 @@ resizemouse(const Arg *arg)
     67  
     68  	if (!(c = selmon->sel))
     69  		return;
     70 -	if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
     71 -		return;
     72  	restack(selmon);
     73  	ocx = c->x;
     74  	ocy = c->y;
     75 @@ -1477,24 +1469,10 @@ setfullscreen(Client *c, int fullscreen)
     76  		XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
     77  			PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
     78  		c->isfullscreen = 1;
     79 -		c->oldstate = c->isfloating;
     80 -		c->oldbw = c->bw;
     81 -		c->bw = 0;
     82 -		c->isfloating = 1;
     83 -		resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
     84 -		XRaiseWindow(dpy, c->win);
     85  	} else if (!fullscreen && c->isfullscreen){
     86  		XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
     87  			PropModeReplace, (unsigned char*)0, 0);
     88  		c->isfullscreen = 0;
     89 -		c->isfloating = c->oldstate;
     90 -		c->bw = c->oldbw;
     91 -		c->x = c->oldx;
     92 -		c->y = c->oldy;
     93 -		c->w = c->oldw;
     94 -		c->h = c->oldh;
     95 -		resizeclient(c, c->x, c->y, c->w, c->h);
     96 -		arrange(c->mon);
     97  	}
     98  }
     99  
    100 @@ -1619,7 +1597,7 @@ showhide(Client *c)
    101  	if (ISVISIBLE(c)) {
    102  		/* show clients top down */
    103  		XMoveWindow(dpy, c->win, c->x, c->y);
    104 -		if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
    105 +		if (!c->mon->lt[c->mon->sellt]->arrange || c->isfloating)
    106  			resize(c, c->x, c->y, c->w, c->h, 0);
    107  		showhide(c->snext);
    108  	} else {
    109 @@ -1713,8 +1691,6 @@ togglefloating(const Arg *arg)
    110  {
    111  	if (!selmon->sel)
    112  		return;
    113 -	if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
    114 -		return;
    115  	selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
    116  	if (selmon->sel->isfloating)
    117  		resize(selmon->sel, selmon->sel->x, selmon->sel->y,
    118 -- 
    119 2.32.0
    120