unsigned int seltags;
unsigned int sellt;
unsigned int tagset[2];
- Bool showbar;
Bool topbar;
struct client *clients;
struct client *sel;
XFreeCursor(dpy, cursor[CurNormal]);
XFreeCursor(dpy, cursor[CurResize]);
XFreeCursor(dpy, cursor[CurMove]);
- while(mons)
+ while(mons) {
cleanupmon(mons);
- if(showsystray) {
- XUnmapWindow(dpy, systray->win);
- XDestroyWindow(dpy, systray->win);
- free(systray);
}
+
+ XUnmapWindow(dpy, systray->win);
+ XDestroyWindow(dpy, systray->win);
+ free(systray);
+
XSync(dpy, False);
XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
}
XClientMessageEvent *cme = &e->xclient;
struct client *c = wintoclient(cme->window);
- if(showsystray && cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
+ if(cme->window == systray->win && cme->message_type == netatom[NetSystemTrayOP]) {
/* add systray icons */
if(cme->data.l[1] == SYSTEM_TRAY_REQUEST_DOCK) {
if(!(c = (struct client*)calloc(1, sizeof(*c))))
m->tagset[0] = m->tagset[1] = 1;
m->mfact = mfact;
m->nmaster = nmaster;
- m->showbar = showbar;
m->topbar = topbar;
m->lt[0] = &layouts[0];
m->lt[1] = &layouts[1 % LENGTH(layouts)];
x = dc.geom.x;
dc.geom.w = TEXTW(stext);
- dc.geom.x = m->win_geom.w - dc.geom.w;
-
- if(showsystray && m == selmon) {
- dc.geom.x -= getsystraywidth();
- }
+ dc.geom.x = m->win_geom.w - dc.geom.w - getsystraywidth();
if(dc.geom.x < x) {
dc.geom.x = x;
width = 0;
- if(showsystray) {
- for(client = systray->icons; client; client = client->next) {
- width += client->geom.w + systrayspacing;
- }
+ for(client = systray->icons; client; client = client->next) {
+ width += client->geom.w + systrayspacing;
}
return(width ? width + systrayspacing : 1);
{
struct client **cur;
- if(!showsystray || !client) {
+ if(!client) {
return;
}
void resizebarwin(struct monitor *m)
{
- unsigned int w = m->win_geom.w;
+ unsigned int w;
- if(showsystray && m == selmon) {
- w -= getsystraywidth();
- }
+ w = m->win_geom.w - getsystraywidth();
XMoveResizeWindow(dpy, m->barwin, m->win_geom.x, m->by, w, bh);
return;
}
-#ifndef M10K
-void togglebar(const union arg *arg)
-{
- selmon->showbar = !selmon->showbar;
- updatebarpos(selmon);
- resizebarwin(selmon);
-
- if(showsystray) {
- XWindowChanges wc;
-
- if(!selmon->showbar) {
- wc.y = -bh;
- } else if(selmon->showbar) {
- wc.y = 0;
-
- if(!selmon->topbar) {
- wc.y = selmon->geom.h - bh;
- }
- }
-
- XConfigureWindow(dpy, systray->win, CWY, &wc);
- }
-
- arrange(selmon);
-
- return;
-}
-#endif /* ! M10K */
-
void togglefloating(const union arg *arg)
{
if(!selmon->sel) {
};
for(m = mons; m; m = m->next) {
- w = m->win_geom.w;
-
- if(showsystray && m == selmon) {
- w -= getsystraywidth();
- }
+ w = m->win_geom.w - getsystraywidth();
m->barwin = XCreateWindow(dpy, root, m->win_geom.x, m->by, w, bh, 0, DefaultDepth(dpy, screen),
CopyFromParent, DefaultVisual(dpy, screen),
{
m->win_geom.y = m->geom.y;
m->win_geom.h = m->geom.h;
-
- if(m->showbar) {
- m->win_geom.h -= bh;
- m->by = m->topbar ? m->win_geom.y : m->win_geom.y + m->win_geom.h;
- m->win_geom.y = m->topbar ? m->win_geom.y + bh : m->win_geom.y;
- } else {
- m->by = -bh;
- }
+ m->win_geom.h -= bh;
+ m->by = m->topbar ? m->win_geom.y : m->win_geom.y + m->win_geom.h;
+ m->win_geom.y = m->topbar ? m->win_geom.y + bh : m->win_geom.y;
return;
}
long flags;
int code = 0;
- if(!showsystray || !i || ev->atom != xatom[XembedInfo] ||
+ if(!i || ev->atom != xatom[XembedInfo] ||
!(flags = getatomprop(i, xatom[XembedInfo]))) {
return;
}
x = selmon->geom.x + selmon->geom.w;
w = 1;
- if(!showsystray) {
- return;
- }
-
if(!systray) {
/* init systray */
if(!(systray = (struct systray*)calloc(1, sizeof(*systray)))) {
struct client *wintosystrayicon(Window w)
{
- struct client *i = NULL;
+ struct client *client;
- if(!showsystray || !w) {
- return(i);
+ if(w) {
+ for(client = systray->icons; client; client = client->next) {
+ if(client->win == w) {
+ return(client);
+ }
+ }
}
- for(i = systray->icons; i && i->win != w; i = i->next);
-
- return(i);
+ return(NULL);
}
/* There's no way to check accesses to destroyed windows, thus those cases are
}
if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) {
- fputs("warning: no locale support\n", stderr);
+ fprintf(stderr, "warning: no locale support\n");
}
dpy = XOpenDisplay(NULL);
cleanup();
XCloseDisplay(dpy);
- return EXIT_SUCCESS;
+ return(EXIT_SUCCESS);
}