Hi, I am using trayer to provide a system tray. I write a patch to make dwm work with trayer. it will be displayed on every tag but will never get focused or displayed at title bar, and you are able to use mouse to click icons on it. dwm will leave a blank area on bottom for the tray after trayer start, and will recycle that area if there is no longer no trayer. Note that you should not add anything to config.h because every thing is hard coded.
I use the following command to start trayer: trayer --height 16 --edge bottom --expand true --transparent true --alpha 0 --tint '#000' On Fri, May 1, 2009 at 9:55 PM, Don Harper <ducku...@gmail.com> wrote: > Is there a way to get a float to not get focus except if I click/mouse > over it? I am using stalonetray with the following rule: > > { "stalonetray", "stalonetray", "stalonetray", ~0, True }, > > This gets the window on all tags like I want, but every time I switch to > a new tag, stalonetray window takes focus, and I want to figure out how > get it to not do it. > > Thanks! > > don > > > -- > Don Harper, RHCE email: ducku...@gmail.com > Just a systems kinda guy... > Men's natures are alike; it is their habits that separate them. - > Confucius >
diff -r a2c094196714 dwm.c --- a/dwm.c Mon Apr 20 11:03:33 2009 +0100 +++ b/dwm.c Fri May 01 22:16:50 2009 +0800 @@ -233,6 +233,7 @@ static Client *clients = NULL; static Client *sel = NULL; static Client *stack = NULL; +static Client *panel = NULL; static Cursor cursor[CurLast]; static Display *dpy; static DC dc; @@ -268,7 +269,8 @@ if(ch.res_name) XFree(ch.res_name); } - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : tagset[seltags]; + if(!c->tags && panel != c) + c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : tagset[seltags]; } Bool @@ -793,7 +795,7 @@ unsigned int i, j; unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask }; XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - if(focused) { + if(focused || panel == c) { for(i = 0; i < LENGTH(buttons); i++) if(buttons[i].click == ClkClientWin) for(j = 0; j < LENGTH(modifiers); j++) @@ -944,6 +946,13 @@ c->bw = borderpx; } + updatetitle(c); + if(strstr(c->name, "panel") || strstr(c->name, "stalonetray")) { + panel = c; + c->bw = 0; + wh = sh - bh - panel->h; + } + wc.border_width = c->bw; XConfigureWindow(dpy, w, CWBorderWidth, &wc); XSetWindowBorder(dpy, w, dc.norm[ColBorder]); @@ -1334,7 +1343,7 @@ showhide(Client *c) { if(!c) return; - if(ISVISIBLE(c)) { /* show clients top down */ + if(ISVISIBLE(c) || panel == c) { /* show clients top down */ XMoveWindow(dpy, c->win, c->x, c->y); if(!lt[sellt]->arrange || c->isfloating) resize(c, c->x, c->y, c->w, c->h); @@ -1465,6 +1474,11 @@ unmanage(Client *c) { XWindowChanges wc; + if(panel == c) { + panel = NULL; + wh = sh - bh; + } + wc.border_width = c->oldbw; /* The server grab construct avoids race conditions. */ XGrabServer(dpy);