different borderwidth for floating windows
This commit is contained in:
18
dwm.c
18
dwm.c
@@ -210,6 +210,7 @@ static void setfloating(const Arg *arg);
|
||||
static void setfullscreen(Client *c, int fullscreen);
|
||||
static void setlayout(const Arg *arg);
|
||||
static void setmfact(const Arg *arg);
|
||||
static void setsticky(const Arg *arg);
|
||||
static void setup(void);
|
||||
static void seturgent(Client *c, int urg);
|
||||
static void showhide(Client *c);
|
||||
@@ -1128,7 +1129,7 @@ manage(Window w, XWindowAttributes *wa)
|
||||
/* only fix client y-offset, if the client center might cover the bar */
|
||||
c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
|
||||
&& (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
|
||||
c->bw = borderpx;
|
||||
c->bw = c->isfloating ? borderfloatpx : borderpx;
|
||||
|
||||
wc.border_width = c->bw;
|
||||
XConfigureWindow(dpy, w, CWBorderWidth, &wc);
|
||||
@@ -1827,6 +1828,8 @@ togglefloating(const Arg *arg)
|
||||
if (selmon->sel->isfloating)
|
||||
resize(selmon->sel, selmon->sel->x, selmon->sel->y,
|
||||
selmon->sel->w, selmon->sel->h, 0);
|
||||
selmon->sel->bw= selmon->sel->isfloating ? borderfloatpx : borderpx;
|
||||
resizeclient(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
@@ -1838,8 +1841,9 @@ setfloating(const Arg *arg)
|
||||
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
|
||||
return;
|
||||
selmon->sel->isfloating = True;
|
||||
resize(selmon->sel, selmon->sel->x, selmon->sel->y,
|
||||
selmon->sel->w, selmon->sel->h, 0);
|
||||
selmon->sel->bw = borderfloatpx;
|
||||
//needed to redraw new thinner border
|
||||
resizeclient(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
@@ -1859,6 +1863,14 @@ togglesticky(const Arg *arg)
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
void
|
||||
setsticky(const Arg *arg)
|
||||
{
|
||||
if (!selmon->sel)
|
||||
return;
|
||||
selmon->sel->issticky = True;
|
||||
arrange(selmon);
|
||||
}
|
||||
void
|
||||
togglescratch(const Arg *arg)
|
||||
{
|
||||
|
Reference in New Issue
Block a user