about summary refs log tree commit diff stats
ModeNameSize
-rw-r--r--.hgtags360log stats plain blame
-rw-r--r--LICENSE1120log stats plain blame
-rw-r--r--Makefile1551log stats plain blame
-rw-r--r--README1094log stats plain blame
-rw-r--r--client.c9042log stats plain blame
-rw-r--r--config.arg.h2165log stats plain blame
-rw-r--r--config.default.h2215log stats plain blame
-rw-r--r--config.mk464log stats plain blame
-rw-r--r--draw.c4982log stats plain blame
-rw-r--r--dwm.12628log stats plain blame
-rw-r--r--dwm.h3310log stats plain blame
-rw-r--r--dwm.html5247log stats plain blame
-rw-r--r--dwm.png373log stats plain blame
-rw-r--r--event.c7981log stats plain blame
-rw-r--r--favicon.ico198log stats plain blame
-rw-r--r--main.c6860log stats plain blame
-rw-r--r--tag.c5084log stats plain blame
-rw-r--r--util.c1143log stats plain blame
drawbar(Monitor *m); static void drawbars(void); -static void enternotify(XEvent *e); static void expose(XEvent *e); static void focus(Client *c); static void focusin(XEvent *e); @@ -206,7 +205,6 @@ static void manage(Window w, XWindowAttributes *wa); static void mappingnotify(XEvent *e); static void maprequest(XEvent *e); static void monocle(Monitor *m); -static void motionnotify(XEvent *e); static void movemouse(const Arg *arg); static Client *nexttiled(Client *c); static void pop(Client *c); @@ -284,13 +282,11 @@ static void (*handler[LASTEvent]) (XEvent *) = { [ConfigureRequest] = configurerequest, [ConfigureNotify] = configurenotify, [DestroyNotify] = destroynotify, - [EnterNotify] = enternotify, [Expose] = expose, [FocusIn] = focusin, [KeyPress] = keypress, [MappingNotify] = mappingnotify, [MapRequest] = maprequest, - [MotionNotify] = motionnotify, [PropertyNotify] = propertynotify, [ResizeRequest] = resizerequest, [UnmapNotify] = unmapnotify @@ -462,7 +458,8 @@ buttonpress(XEvent *e) click = ClkRootWin; /* focus monitor if necessary */ - if ((m = wintomon(ev->window)) && m != selmon) { + if ((m = wintomon(ev->window)) && m != selmon + && (focusonwheel || (ev->button != Button4 && ev->button != Button5))) { unfocus(selmon->sel, 1); selmon = m; focus(NULL); @@ -482,8 +479,8 @@ buttonpress(XEvent *e) else click = ClkWinTitle; } else if ((c = wintoclient(ev->window))) { - focus(c); - restack(selmon); + if (focusonwheel || (ev->button != Button4 && ev->button != Button5)) + focus(c); XAllowEvents(dpy, ReplayPointer, CurrentTime); click = ClkClientWin; } @@ -859,25 +856,6 @@ drawbars(void) drawbar(m); } -void -enternotify(XEvent *e) -{ - Client *c; - Monitor *m; - XCrossingEvent *ev = &e->xcrossing; - - if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) - return; - c = wintoclient(ev->window); - m = c ? c->mon : wintomon(ev->window); - if (m != selmon) { - unfocus(selmon->sel, 1); - selmon = m; - } else if (!c || c == selmon->sel) - return; - focus(c); -} - void expose(XEvent *e) { @@ -1257,23 +1235,6 @@ monocle(Monitor *m) resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0); } -void -motionnotify(XEvent *e) -{ - static Monitor *mon = NULL; - Monitor *m; - XMotionEvent *ev = &e->xmotion; - - if (ev->window != root) - return; - if ((m = recttomon(ev->x_root, ev->y_root, 1, 1)) != mon && mon) { - unfocus(selmon->sel, 1); - selmon = m; - focus(NULL); - } - mon = m; -} - void movemouse(const Arg *arg) { -- 2.38.0