Merge branch 'fakefullscreen'

keyboard
Jonathan Hodgson 6 years ago
commit a3fdaddab1
  1. 28
      dwm.c

28
dwm.c

@ -537,7 +537,7 @@ clientmessage(XEvent *e)
if (cme->data.l[1] == netatom[NetWMFullscreen] if (cme->data.l[1] == netatom[NetWMFullscreen]
|| cme->data.l[2] == netatom[NetWMFullscreen]) || cme->data.l[2] == netatom[NetWMFullscreen])
setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */ 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 */));
} else if (cme->message_type == netatom[NetActiveWindow]) { } else if (cme->message_type == netatom[NetActiveWindow]) {
if (c != selmon->sel && !c->isurgent) if (c != selmon->sel && !c->isurgent)
seturgent(c, 1); seturgent(c, 1);
@ -567,7 +567,6 @@ void
configurenotify(XEvent *e) configurenotify(XEvent *e)
{ {
Monitor *m; Monitor *m;
Client *c;
XConfigureEvent *ev = &e->xconfigure; XConfigureEvent *ev = &e->xconfigure;
int dirty; int dirty;
@ -580,9 +579,6 @@ configurenotify(XEvent *e)
drw_resize(drw, sw, bh); drw_resize(drw, sw, bh);
updatebars(); updatebars();
for (m = mons; m; m = m->next) { 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); XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
} }
focus(NULL); focus(NULL);
@ -1162,8 +1158,6 @@ movemouse(const Arg *arg)
if (!(c = selmon->sel)) if (!(c = selmon->sel))
return; return;
if (c->isfullscreen) /* no support moving fullscreen windows by mouse */
return;
restack(selmon); restack(selmon);
ocx = c->x; ocx = c->x;
ocy = c->y; ocy = c->y;
@ -1317,8 +1311,6 @@ resizemouse(const Arg *arg)
if (!(c = selmon->sel)) if (!(c = selmon->sel))
return; return;
if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */
return;
restack(selmon); restack(selmon);
ocx = c->x; ocx = c->x;
ocy = c->y; ocy = c->y;
@ -1498,24 +1490,10 @@ setfullscreen(Client *c, int fullscreen)
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
c->isfullscreen = 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){ } else if (!fullscreen && c->isfullscreen){
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)0, 0); PropModeReplace, (unsigned char*)0, 0);
c->isfullscreen = 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);
} }
} }
@ -1640,7 +1618,7 @@ showhide(Client *c)
if (ISVISIBLE(c)) { if (ISVISIBLE(c)) {
/* show clients top down */ /* show clients top down */
XMoveWindow(dpy, c->win, c->x, c->y); 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)
resize(c, c->x, c->y, c->w, c->h, 0); resize(c, c->x, c->y, c->w, c->h, 0);
showhide(c->snext); showhide(c->snext);
} else { } else {
@ -1732,8 +1710,6 @@ togglefloating(const Arg *arg)
{ {
if (!selmon->sel) if (!selmon->sel)
return; return;
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
return;
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed; selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
if (selmon->sel->isfloating) if (selmon->sel->isfloating)
resize(selmon->sel, selmon->sel->x, selmon->sel->y, resize(selmon->sel, selmon->sel->x, selmon->sel->y,

Loading…
Cancel
Save