Xinqi Bao's Git
projects
/
dwm.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
applied anydots proposal to let togglefloating restore fixed windows
[dwm.git]
/
client.c
diff --git
a/client.c
b/client.c
index
3db14f5
..
040dd15
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-152,6
+152,14
@@
focus(Client *c) {
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
+void
+focustopvisible(void) {
+ Client *c;
+
+ for(c = stack; c && !isvisible(c); c = c->snext);
+ focus(c);
+}
+
void
killclient(const char *arg) {
XEvent ev;
void
killclient(const char *arg) {
XEvent ev;
@@
-297,6
+305,8
@@
togglefloating(const char *arg) {
if(!sel || lt->arrange == floating)
return;
sel->isfloating = !sel->isfloating;
if(!sel || lt->arrange == floating)
return;
sel->isfloating = !sel->isfloating;
+ if(sel->isfloating && sel->isfixed)
+ resize(sel, sel->x, sel->y, sel->minw, sel->minh, True);
lt->arrange();
}
lt->arrange();
}
@@
-381,7
+391,6
@@
updatetitle(Client *c) {
void
unmanage(Client *c) {
void
unmanage(Client *c) {
- Client *nc;
XWindowChanges wc;
wc.border_width = c->oldborder;
XWindowChanges wc;
wc.border_width = c->oldborder;
@@
-391,10
+400,8
@@
unmanage(Client *c) {
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
detach(c);
detachstack(c);
XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
detach(c);
detachstack(c);
- if(sel == c) {
- for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
- focus(nc);
- }
+ if(sel == c)
+ focustopvisible();
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
setclientstate(c, WithdrawnState);
free(c->tags);
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
setclientstate(c, WithdrawnState);
free(c->tags);