diff options
| author | Quentin Rameau <quinq+hackers@fifth.space> | 2015-11-07 14:09:08 +0100 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-11-07 14:31:21 +0100 |
| commit | dce4fb373757727374d00c857ec0dfd225bbeafd (patch) | |
| tree | 90d4a9f92b62603cf2bd85fc749db57608b903ab | |
| parent | sync updated drw code from dmenu (diff) | |
| download | dwm-dce4fb373757727374d00c857ec0dfd225bbeafd.tar.gz dwm-dce4fb373757727374d00c857ec0dfd225bbeafd.zip | |
setfullscreen: don't process the property twice
Some clients try to set _NET_WM_STATE_FULLSCREEN even when the window is
already in fullscreen.
For example, c->oldstate was set two times in a raw and window would
then always be floating.
We must check that it's not the case before processing it.
(original patch modified with suggestion from Markus Teich
<markus.teich@stusta.mhn.de>)
| -rw-r--r-- | dwm.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1441,7 +1441,7 @@ setfocus(Client *c) { | |||
| 1441 | 1441 | ||
| 1442 | void | 1442 | void |
| 1443 | setfullscreen(Client *c, Bool fullscreen) { | 1443 | setfullscreen(Client *c, Bool fullscreen) { |
| 1444 | if(fullscreen) { | 1444 | if(fullscreen && !c->isfullscreen) { |
| 1445 | XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, | 1445 | XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, |
| 1446 | PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); | 1446 | PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); |
| 1447 | c->isfullscreen = True; | 1447 | c->isfullscreen = True; |
| @@ -1452,7 +1452,7 @@ setfullscreen(Client *c, Bool fullscreen) { | |||
| 1452 | resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); | 1452 | resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); |
| 1453 | XRaiseWindow(dpy, c->win); | 1453 | XRaiseWindow(dpy, c->win); |
| 1454 | } | 1454 | } |
| 1455 | else { | 1455 | else if(!fullscreen && c->isfullscreen){ |
| 1456 | XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, | 1456 | XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, |
| 1457 | PropModeReplace, (unsigned char*)0, 0); | 1457 | PropModeReplace, (unsigned char*)0, 0); |
| 1458 | c->isfullscreen = False; | 1458 | c->isfullscreen = False; |
