int screen_number;
float mfact;
int by, btx; /* bar geometry */
+ int my, mh; /* vertical screen size*/
int wx, wy, ww, wh; /* window area */
unsigned int seltags;
unsigned int sellt;
static void unmanage(Client *c);
static void unmapnotify(XEvent *e);
static void updategeom(void);
+static void updatebarpos(Monitor *m);
static void updatebars(void);
static void updatenumlockmask(void);
static void updatesizehints(Client *c);
XButtonPressedEvent *ev = &e->xbutton;
click = ClkRootWin;
- if(ev->window == selmon->barwin) {
+ if(ev->window == selmon->barwin && ev->x >= selmon->btx) {
i = 0;
x = selmon->btx;
do
void
drawbar(Monitor *m) {
+ char buf[2];
int x;
unsigned int i, occ = 0, urg = 0;
unsigned long *col;
dc.x = 0;
#ifdef XINERAMA
{
- /*
- dc.w = TEXTW(m->symbol);
- drawtext(NULL, selmon == m ? dc.sel : dc.norm, False);
+ buf[0] = m->screen_number + '0';
+ buf[1] = '\0';
+ dc.w = TEXTW(buf);
+ drawtext(buf, selmon == m ? dc.sel : dc.norm, True);
dc.x += dc.w;
- */
}
#endif /* XINERAMA */
m->btx = dc.x;
void
togglebar(const Arg *arg) {
selmon->showbar = !selmon->showbar;
- updategeom();
+ updatebarpos(selmon);
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
arrange();
}
}
}
+void
+updatebarpos(Monitor *m) {
+ m->wy = m->my;
+ m->wh = m->mh;
+ if(m->showbar) {
+ m->wh -= bh;
+ m->by = m->topbar ? m->wy : m->wy + m->wh;
+ m->wy = m->topbar ? m->wy + bh : m->wy;
+ }
+ else
+ m->by = -bh;
+}
+
void
updategeom(void) {
int i, n;
for(i = 0, m = newmons; m; m = m->next, i++) {
m->screen_number = info[i].screen_number;
m->wx = info[i].x_org;
- m->wy = info[i].y_org;
+ m->my = m->wy = info[i].y_org;
m->ww = info[i].width;
- m->wh = info[i].height;
+ m->mh = m->wh = info[i].height;
}
XFree(info);
}
{
m->screen_number = 0;
m->wx = sx;
- m->wy = sy;
+ m->my = m->wy = sy;
m->ww = sw;
- m->wh = sh;
+ m->mh = m->wh = sh;
}
/* bar geometry setup */
m->mfact = mfact;
m->showbar = showbar;
m->topbar = topbar;
- if(m->showbar) {
- m->wh -= bh;
- m->by = m->topbar ? m->wy : m->wy + m->wh;
- m->wy = m->topbar ? m->wy + bh : m->wy;
- }
- else
- m->by = -bh;
+ updatebarpos(m);
/* reassign all clients with same screen number */
for(c = clients; c; c = c->next)
if(c->m->screen_number == m->screen_number)