Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implemented restack behavior (floats are on top in tiled mode)
[dwm.git]
/
client.c
diff --git
a/client.c
b/client.c
index
9b91ab6
..
ecfd8f0
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-24,7
+24,7
@@
resizetitle(Client *c)
c->tw = c->w + 2;
c->tx = c->x + c->w - c->tw + 2;
c->ty = c->y;
c->tw = c->w + 2;
c->tx = c->x + c->w - c->tw + 2;
c->ty = c->y;
- if(c->tags[tsel])
+ if(isvisible(c))
XMoveResizeWindow(dpy, c->title, c->tx, c->ty, c->tw, c->th);
else
XMoveResizeWindow(dpy, c->title, c->tx + 2 * sw, c->ty, c->tw, c->th);
XMoveResizeWindow(dpy, c->title, c->tx, c->ty, c->tw, c->th);
else
XMoveResizeWindow(dpy, c->title, c->tx + 2 * sw, c->ty, c->tw, c->th);
@@
-49,6
+49,8
@@
ban(Client *c)
void
focus(Client *c)
{
void
focus(Client *c)
{
+ if (!issel)
+ return;
Client *old = sel;
XEvent ev;
Client *old = sel;
XEvent ev;
@@
-57,10
+59,6
@@
focus(Client *c)
drawtitle(old);
drawtitle(c);
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
drawtitle(old);
drawtitle(c);
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
- XSync(dpy, False);
- XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32,
- PropModeReplace, (unsigned char *)&c->win, 1);
- while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
void
}
void
@@
-77,8
+75,8
@@
focusnext(Arg *arg)
if(!(c = getnext(sel->next)))
c = getnext(clients);
if(c) {
if(!(c = getnext(sel->next)))
c = getnext(clients);
if(c) {
- higher(c);
focus(c);
focus(c);
+ restack();
}
}
}
}
@@
-98,8
+96,8
@@
focusprev(Arg *arg)
c = getprev(c);
}
if(c) {
c = getprev(c);
}
if(c) {
- higher(c);
focus(c);
focus(c);
+ restack();
}
}
}
}
@@
-181,13
+179,6
@@
gravitate(Client *c, Bool invert)
}
void
}
void
-higher(Client *c)
-{
- XRaiseWindow(dpy, c->win);
- XRaiseWindow(dpy, c->title);
-}
-
-void
killclient(Arg *arg)
{
if(!sel)
killclient(Arg *arg)
{
if(!sel)
@@
-199,13
+190,6
@@
killclient(Arg *arg)
}
void
}
void
-lower(Client *c)
-{
- XLowerWindow(dpy, c->title);
- XLowerWindow(dpy, c->win);
-}
-
-void
manage(Window w, XWindowAttributes *wa)
{
Client *c;
manage(Window w, XWindowAttributes *wa)
{
Client *c;
@@
-278,13
+262,12
@@
manage(Window w, XWindowAttributes *wa)
|| (c->maxw && c->minw &&
c->maxw == c->minw && c->maxh == c->minh);
settitle(c);
|| (c->maxw && c->minw &&
c->maxw == c->minw && c->maxh == c->minh);
settitle(c);
- arrange(NULL);
- /* mapping the window now prevents flicker */
- XMapRaised(dpy, c->win);
- XMapRaised(dpy, c->title);
- if(c->tags[tsel])
+ XMapWindow(dpy, c->win);
+ XMapWindow(dpy, c->title);
+ if(isvisible(c))
focus(c);
focus(c);
+ arrange(NULL);
}
void
}
void
@@
-417,8
+400,8
@@
togglemax(Arg *arg)
sel->w = sw - 2;
sel->h = sh - 2 - bh;
sel->w = sw - 2;
sel->h = sh - 2 - bh;
- higher(sel);
- resize(sel, False, TopLeft);
+ restack();
+ resize(sel, arrange == dofloat, TopLeft);
sel->x = ox;
sel->y = oy;
sel->x = ox;
sel->y = oy;
@@
-445,25
+428,17
@@
unmanage(Client *c)
c->next->prev = c->prev;
if(c == clients)
clients = c->next;
c->next->prev = c->prev;
if(c == clients)
clients = c->next;
- if(sel == c) {
- sel = getnext(c->next);
- if(!sel)
- sel = getprev(c->prev);
- if(!sel)
- sel = clients;
- }
+ if(sel == c)
+ sel = getnext(clients);
free(c->tags);
free(c);
XSync(dpy, False);
XSetErrorHandler(xerror);
XUngrabServer(dpy);
free(c->tags);
free(c);
XSync(dpy, False);
XSetErrorHandler(xerror);
XUngrabServer(dpy);
- arrange(NULL);
if(sel)
focus(sel);
if(sel)
focus(sel);
- else
- XChangeProperty(dpy, root, netatom[NetActiveWindow], XA_WINDOW, 32,
- PropModeReplace, (unsigned char *)NULL, 1);
+ arrange(NULL);
}
void
}
void
@@
-471,7
+446,7
@@
zoom(Arg *arg)
{
Client *c;
{
Client *c;
- if(!sel || (arrange != dotile) || sel->isfloat)
+ if(!sel || (arrange != dotile) || sel->isfloat || sel->ismax)
return;
if(sel == getnext(clients)) {
return;
if(sel == getnext(clients)) {
@@
-482,15
+457,13
@@
zoom(Arg *arg)
}
/* pop */
}
/* pop */
- if(sel->prev)
- sel->prev->next = sel->next;
+ sel->prev->next = sel->next;
if(sel->next)
sel->next->prev = sel->prev;
sel->prev = NULL;
if(sel->next)
sel->next->prev = sel->prev;
sel->prev = NULL;
- if(clients)
- clients->prev = sel;
+ clients->prev = sel;
sel->next = clients;
clients = sel;
sel->next = clients;
clients = sel;
- arrange(NULL);
focus(sel);
focus(sel);
+ arrange(NULL);
}
}