diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 59 |
1 files changed, 16 insertions, 43 deletions
@@ -71,7 +71,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel, SchemeSelTab }; /* color schemes */ +enum { SchemeNorm, SchemeSel }; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetSystemTray, NetSystemTrayOP, NetSystemTrayOrientation, NetSystemTrayOrientationHorz, NetWMFullscreen, NetActiveWindow, NetWMWindowType, @@ -106,7 +106,7 @@ struct Client { int basew, baseh, incw, inch, maxw, maxh, minw, minh, hintsvalid; int bw, oldbw; unsigned int tags; - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, resizehints; + int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; Client *next; Client *snext; Monitor *mon; @@ -161,7 +161,6 @@ typedef struct { unsigned int tags; int isfloating; int monitor; - int resizehints; } Rule; typedef struct Systray Systray; @@ -176,7 +175,6 @@ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interac static void arrange(Monitor *m); static void arrangemon(Monitor *m); static void attach(Client *c); -static void attachBelow(Client *c); static void attachstack(Client *c); static void buttonpress(XEvent *e); static void checkotherwm(void); @@ -343,7 +341,6 @@ applyrules(Client *c) { c->isfloating = r->isfloating; c->tags |= r->tags; - c->resizehints = r->resizehints; for (m = mons; m && m->num != r->monitor; m = m->next); if (m) c->mon = m; @@ -388,7 +385,7 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact) *h = bh; if (*w < bh) *w = bh; - if (c->resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { + if (resizehints || c->isfloating || !c->mon->lt[c->mon->sellt]->arrange) { if (!c->hintsvalid) updatesizehints(c); /* see last two sentences in ICCCM 4.1.2.3 */ @@ -453,21 +450,6 @@ attach(Client *c) c->next = c->mon->clients; c->mon->clients = c; } -void -attachBelow(Client *c) -{ - //If there is nothing on the monitor or the selected client is floating, attach as normal - if(c->mon->sel == NULL || c->mon->sel == c || c->mon->sel->isfloating) { - attach(c); - return; - } - - //Set the new client's next property to the same as the currently selected clients next - c->next = c->mon->sel->next; - //Set the currently selected clients next property to the new client - c->mon->sel->next = c; - -} void attachstack(Client *c) @@ -523,7 +505,8 @@ buttonpress(XEvent *e) click = ClkTabBar; arg.ui = i; } - } else if ((c = wintoclient(ev->window))) { + } + else if((c = wintoclient(ev->window))) { if (focusonwheel || (ev->button != Button4 && ev->button != Button5)) focus(c); XAllowEvents(dpy, ReplayPointer, CurrentTime); @@ -942,7 +925,7 @@ drawtab(Monitor *m) { /* add the remainder to the last tab so there is no leftover space left*/ if(remainder && i == m->ntabs - 1) m->tab_widths[i] += remainder; w = m->tab_widths[i]; - drw_setscheme(drw, scheme[(c == m->sel) ? SchemeSelTab : SchemeNorm]); + drw_setscheme(drw, scheme[(c == m->sel) ? SchemeSel : SchemeNorm]); tm = (m->tab_widths[i] - (int)TEXTW(c->name)) / 2; tm = (int)TEXTW(c->name) >= m->tab_widths[i] ? lrpad / 2 : tm; drw_text(drw, x, 0, w, th, tm, c->name, 0); @@ -1036,16 +1019,16 @@ focusstack(const Arg *arg) return; if (arg->i > 0) { for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); - /* if (!c) */ - /* for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); */ + if (!c) + for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); } else { for (i = selmon->clients; i != selmon->sel; i = i->next) if (ISVISIBLE(i)) c = i; - /* if (!c) */ - /* for (; i; i = i->next) */ - /* if (ISVISIBLE(i)) */ - /* c = i; */ + if (!c) + for (; i; i = i->next) + if (ISVISIBLE(i)) + c = i; } if (c) { focus(c); @@ -1267,7 +1250,6 @@ manage(Window w, XWindowAttributes *wa) c->w = c->oldw = wa->width; c->h = c->oldh = wa->height; c->oldbw = wa->border_width; - c->resizehints = resizehints; updatetitle(c); if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) { @@ -1301,10 +1283,7 @@ manage(Window w, XWindowAttributes *wa) c->isfloating = c->oldstate = trans != None || c->isfixed; if (c->isfloating) XRaiseWindow(dpy, c->win); - if( attachbelow ) - attachBelow(c); - else - attach(c); + attach(c); attachstack(c); XChangeProperty(dpy, root, netatom[NetClientList], XA_WINDOW, 32, PropModeAppend, (unsigned char *) &(c->win), 1); @@ -1315,7 +1294,7 @@ manage(Window w, XWindowAttributes *wa) c->mon->sel = c; arrange(c->mon); XMapWindow(dpy, c->win); - focus(NULL); + focus(NULL); } void @@ -1695,10 +1674,7 @@ sendmon(Client *c, Monitor *m) detachstack(c); c->mon = m; c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ - if( attachbelow ) - attachBelow(c); - else - attach(c); + attach(c); attachstack(c); focus(NULL); arrange(NULL); @@ -2287,10 +2263,7 @@ updategeom(void) m->clients = c->next; detachstack(c); c->mon = mons; - if( attachbelow ) - attachBelow(c); - else - attach(c); + attach(c); attachstack(c); } if (m == selmon) |
