diff --git a/src/client.c b/src/client.c index 891fa4b..93995b3 100644 --- a/src/client.c +++ b/src/client.c @@ -616,7 +616,7 @@ client_map(Client *c) { CHECK(c); - if(c->flags & FSSFlag) + if(c->flags & FSSFlag || c->flags & DockFlag) XMapWindow(dpy, c->win); else { diff --git a/src/draw.c b/src/draw.c index 5e5e41f..2bf0600 100644 --- a/src/draw.c +++ b/src/draw.c @@ -52,7 +52,7 @@ draw_text(Drawable d, int x, int y, char* fg, int pad, char *str) /* To draw image everywhere we can draw text */ #ifdef HAVE_IMLIB char *ostr = NULL; - int i, ni; + int i, ni, sw = 0; ImageAttr im[128]; ostr = _strdup(str); @@ -61,8 +61,11 @@ draw_text(Drawable d, int x, int y, char* fg, int pad, char *str) { ni = parse_image_block(im, str); + if(d == infobar[0 /* SYSTRAY_SCREEN */].bar->dr) + sw = systray_get_width(); + for(i = 0; i < ni; ++i) - draw_image(d, im[i].x, im[i].y, im[i].w, im[i].h, im[i].name); + draw_image(d, im[i].x - sw, im[i].y, im[i].w, im[i].h, im[i].name); } #endif /* HAVE_IMLIB */ diff --git a/src/ewmh.c b/src/ewmh.c index 5cd2091..e097285 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -436,6 +436,8 @@ ewmh_manage_window_type(Client *c) /* Reparent it to ROOT win */ XReparentWindow(dpy, c->win, ROOT, c->geo.x, c->geo.y); XRaiseWindow(dpy, c->win); + + c->flags |= DockFlag; } /* MANAGE _NET_WM_WINDOW_TYPE_DIALOG */ else if(atom[i] == net_atom[net_wm_window_type_dialog]) diff --git a/src/status.c b/src/status.c index 5ac3d13..519add4 100644 --- a/src/status.c +++ b/src/status.c @@ -141,7 +141,11 @@ statustext_normal(int sc, char *str) char strwc[MAXSTATUS] = { 0 }; char buf[MAXSTATUS] = { 0 }; char col[8] = { 0 }; - int n, i, j, k; + int n, i, j, k, sw = 0; + + /* if(sc == SYSTRAY_SCREEN) */ + if(!sc) + sw = systray_get_width(); for(i = j = n = 0; i < strlen(str); ++i, ++j) if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\') @@ -154,7 +158,7 @@ statustext_normal(int sc, char *str) strwc[j] = str[i]; /* Draw normal text without any blocks */ - draw_text(infobar[sc].bar->dr, (sgeo[sc].width - SHADH) - textw(strwc), + draw_text(infobar[sc].bar->dr, (sgeo[sc].width - SHADH) - (textw(strwc) + sw++), FHINFOBAR, infobar[sc].bar->fg, 0, strwc); if(n) @@ -169,11 +173,11 @@ statustext_normal(int sc, char *str) /* Draw a rectangle with the bar color to draw the text properly */ draw_rectangle(infobar[sc].bar->dr, (sgeo[sc].width - SHADH) - textw(&buf[k]), - 0, INFOBARH - (sgeo[sc].width - SHADH) - textw(&buf[k]), + 0, INFOBARH - (sgeo[sc].width - SHADH) - (textw(&buf[k]) + sw), INFOBARH, conf.colors.bar); /* Draw text with its color */ - draw_text(infobar[sc].bar->dr, (sgeo[sc].width - SHADH) - textw(&buf[k]), + draw_text(infobar[sc].bar->dr, (sgeo[sc].width - SHADH) - (textw(&buf[k]) + sw), FHINFOBAR, col, 0, &buf[k]); strcpy(buf, strwc); @@ -192,7 +196,7 @@ void statustext_handle(int sc, char *str) { char *lastst; - int i, nr, ng, ns, len; + int i, nr, ng, ns, len, sw = 0; StatusRec r[128]; StatusGraph g[128]; StatusText s[128]; @@ -201,6 +205,11 @@ statustext_handle(int sc, char *str) if(!str) return; + /* if(sc == SYSTRAY_SCREEN) */ + if(!sc) + sw = systray_get_width(); + + barwin_refresh_color(infobar[sc].bar); /* save last status text address (for free at the end) */ @@ -219,15 +228,15 @@ statustext_handle(int sc, char *str) /* Draw rectangles with stored properties. */ for(i = 0; i < nr; ++i) - draw_rectangle(infobar[sc].bar->dr, r[i].x, r[i].y, r[i].w, r[i].h, r[i].color); + draw_rectangle(infobar[sc].bar->dr, r[i].x - sw, r[i].y, r[i].w, r[i].h, r[i].color); /* Draw graphs with stored properties. */ for(i = 0; i < ng; ++i) - draw_graph(infobar[sc].bar->dr, g[i].x, g[i].y, g[i].w, g[i].h, g[i].color, g[i].data); + draw_graph(infobar[sc].bar->dr, g[i].x - sw, g[i].y, g[i].w, g[i].h, g[i].color, g[i].data); /* Draw located text with stored properties. */ for(i = 0; i < ns; ++i) - draw_text(infobar[sc].bar->dr, s[i].x, s[i].y, s[i].color, 0, s[i].text); + draw_text(infobar[sc].bar->dr, s[i].x - sw, s[i].y, s[i].color, 0, s[i].text); barwin_refresh(infobar[sc].bar); diff --git a/src/structs.h b/src/structs.h index 2bfae0b..4b64816 100644 --- a/src/structs.h +++ b/src/structs.h @@ -52,6 +52,7 @@ #define AboveFlag (1 << 9) #define UrgentFlag (1 << 10) #define FLayFlag (1 << 11) +#define DockFlag (1 << 12) #define TagFlag(t) (1 << (t)) diff --git a/src/systray.c b/src/systray.c index fcf6d20..f9bf291 100644 --- a/src/systray.c +++ b/src/systray.c @@ -32,7 +32,8 @@ #include "wmfs.h" -#define TRAY_DWIDTH 18 +#define TRAY_SPACING (3) +#define TRAY_DWIDTH (infobar[0].bar->geo.height + TRAY_SPACING) Bool systray_acquire(void) @@ -208,7 +209,7 @@ systray_get_width(void) Systray *i; for(i = trayicons; i; i = i->next) - w += i->geo.width + 2; + w += i->geo.width + TRAY_SPACING + 1; return w; } @@ -218,7 +219,7 @@ systray_update(void) { Systray *i; XWindowAttributes xa; - int x = 0; + int x = 1; if(!trayicons) { @@ -241,7 +242,7 @@ systray_update(void) XMoveResizeWindow(dpy, i->win, (i->geo.x = x), 0, i->geo.width, i->geo.height); - x += i->geo.width + 2; + x += i->geo.width + TRAY_SPACING; } XMoveResizeWindow(dpy, traywin, infobar[0].bar->geo.width - x, 0, x, infobar[0].bar->geo.height); diff --git a/src/wmfs.h b/src/wmfs.h index 360c04d..8828de1 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -54,8 +54,6 @@ #include #include #include -#include -#include #include #include #include