summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/dwm.c b/dwm.c
index c992860..64bafb7 100644
--- a/dwm.c
+++ b/dwm.c
@@ -60,7 +60,7 @@ enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
60enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */ 60enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
61enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */ 61enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
62enum { ClkLtSymbol = 64, ClkStatusText, ClkWinTitle, 62enum { ClkLtSymbol = 64, ClkStatusText, ClkWinTitle,
63 ClkClientWin, ClkLast }; /* clicks */ 63 ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
64 64
65/* typedefs */ 65/* typedefs */
66typedef unsigned int uint; 66typedef unsigned int uint;
@@ -84,12 +84,12 @@ typedef struct {
84typedef struct Client Client; 84typedef struct Client Client;
85struct Client { 85struct Client {
86 char name[256]; 86 char name[256];
87 float mina, maxa;
87 int x, y, w, h; 88 int x, y, w, h;
88 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 89 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
89 float mina, maxa;
90 int bw, oldbw; 90 int bw, oldbw;
91 Bool isbanned, isfixed, isfloating, ismoved, isurgent;
92 uint tags; 91 uint tags;
92 Bool isbanned, isfixed, isfloating, ismoved, isurgent;
93 Client *next; 93 Client *next;
94 Client *snext; 94 Client *snext;
95 Window win; 95 Window win;
@@ -312,7 +312,7 @@ buttonpress(XEvent *e) {
312 Client *c; 312 Client *c;
313 XButtonPressedEvent *ev = &e->xbutton; 313 XButtonPressedEvent *ev = &e->xbutton;
314 314
315 click = ClkLast; 315 click = ClkRootWin;
316 if(ev->window == barwin) { 316 if(ev->window == barwin) {
317 i = x = 0; 317 i = x = 0;
318 do 318 do
@@ -327,8 +327,10 @@ buttonpress(XEvent *e) {
327 else 327 else
328 click = ClkWinTitle; 328 click = ClkWinTitle;
329 } 329 }
330 else if((c = getclient(ev->window))) 330 else if((c = getclient(ev->window))) {
331 focus(c);
331 click = ClkClientWin; 332 click = ClkClientWin;
333 }
332 334
333 for(i = 0; i < LENGTH(buttons); i++) 335 for(i = 0; i < LENGTH(buttons); i++)
334 if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button 336 if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
@@ -1374,7 +1376,7 @@ setup(void) {
1374 PropModeReplace, (unsigned char *) netatom, NetLast); 1376 PropModeReplace, (unsigned char *) netatom, NetLast);
1375 1377
1376 /* select for events */ 1378 /* select for events */
1377 wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask 1379 wa.event_mask = SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask
1378 |EnterWindowMask|LeaveWindowMask|StructureNotifyMask; 1380 |EnterWindowMask|LeaveWindowMask|StructureNotifyMask;
1379 XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa); 1381 XChangeWindowAttributes(dpy, root, CWEventMask|CWCursor, &wa);
1380 XSelectInput(dpy, root, wa.event_mask); 1382 XSelectInput(dpy, root, wa.event_mask);