enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
enum { ClkLtSymbol = 64, ClkStatusText, ClkWinTitle,
- ClkClientWin, ClkLast }; /* clicks */
+ ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
/* typedefs */
typedef unsigned int uint;
typedef struct Client Client;
struct Client {
char name[256];
+ float mina, maxa;
int x, y, w, h;
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
- float mina, maxa;
int bw, oldbw;
- Bool isbanned, isfixed, isfloating, ismoved, isurgent;
uint tags;
+ Bool isbanned, isfixed, isfloating, ismoved, isurgent;
Client *next;
Client *snext;
Window win;
Client *c;
XButtonPressedEvent *ev = &e->xbutton;
- click = ClkLast;
+ click = ClkRootWin;
if(ev->window == barwin) {
i = x = 0;
do
else
click = ClkWinTitle;
}
- else if((c = getclient(ev->window)))
+ else if((c = getclient(ev->window))) {
+ focus(c);
click = ClkClientWin;
+ }
for(i = 0; i < LENGTH(buttons); i++)
if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
PropModeReplace, (unsigned char *) netatom, NetLast);
/* select for events */
- wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask
+ wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask
|EnterWindowMask|LeaveWindowMask|StructureNotifyMask;
XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
XSelectInput(dpy, root, wa.event_mask);