mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
fakefullscreen: prevent focus from drifting away from client when going from fullscreen to fake fullscreen
This commit is contained in:
parent
2e314578ed
commit
c257e2e390
15
dwm.c
15
dwm.c
@ -2494,7 +2494,13 @@ resizeclient(Client *c, int x, int y, int w, int h)
|
||||
#if MONOCLE_LAYOUT
|
||||
|| &monocle == c->mon->lt[c->mon->sellt]->arrange
|
||||
#endif // MONOCLE_LAYOUT
|
||||
) && !c->isfullscreen && !c->isfloating
|
||||
)
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
&& (c->fakefullscreen == 1 || !c->isfullscreen) && c->fakefullscreen
|
||||
#else
|
||||
&& !c->isfullscreen
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
&& !c->isfloating
|
||||
&& c->mon->lt[c->mon->sellt]->arrange) {
|
||||
c->w = wc.width += c->bw * 2;
|
||||
c->h = wc.height += c->bw * 2;
|
||||
@ -2503,7 +2509,14 @@ resizeclient(Client *c, int x, int y, int w, int h)
|
||||
#endif // NOBORDER_PATCH
|
||||
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
|
||||
configure(c);
|
||||
#if FAKEFULLSCREEN_CLIENT_PATCH
|
||||
if (c->fakefullscreen == 1)
|
||||
XSync(dpy, True);
|
||||
else
|
||||
XSync(dpy, False);
|
||||
#else
|
||||
XSync(dpy, False);
|
||||
#endif // FAKEFULLSCREEN_CLIENT_PATCH
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1,27 +1,35 @@
|
||||
void
|
||||
togglefakefullscreen(const Arg *arg)
|
||||
{
|
||||
Client *c = selmon->sel;
|
||||
if (!c)
|
||||
return;
|
||||
Client *c = selmon->sel;
|
||||
if (!c)
|
||||
return;
|
||||
|
||||
if (c->fakefullscreen) {
|
||||
if (c->isfullscreen)
|
||||
c->fakefullscreen = 0;
|
||||
else
|
||||
c->isfullscreen = 0;
|
||||
} else {
|
||||
if (c->isfullscreen) {
|
||||
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);
|
||||
}
|
||||
c->fakefullscreen = 1;
|
||||
c->isfullscreen = 0;
|
||||
}
|
||||
setfullscreen(c, !c->isfullscreen);
|
||||
if (c->fakefullscreen) {
|
||||
if (c->isfullscreen) {
|
||||
if (c->isfloating && c->fakefullscreen == 1) {
|
||||
c->oldstate = c->isfloating;
|
||||
c->oldx = c->x;
|
||||
c->oldy = c->y;
|
||||
c->oldw = c->w;
|
||||
c->oldh = c->h;
|
||||
}
|
||||
c->fakefullscreen = 0;
|
||||
}
|
||||
else
|
||||
c->isfullscreen = 0;
|
||||
} else {
|
||||
c->fakefullscreen = 1;
|
||||
if (c->isfullscreen) {
|
||||
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);
|
||||
}
|
||||
c->isfullscreen = 0;
|
||||
}
|
||||
setfullscreen(c, !c->isfullscreen);
|
||||
}
|
Loading…
Reference in New Issue
Block a user