JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Button3 click on mode label toggles stack position now
[dwm.git] / event.c
diff --git a/event.c b/event.c
index 50c59a0..a17034c 100644 (file)
--- a/event.c
+++ b/event.c
@@ -1,4 +1,3 @@
-#include <stdio.h>
 /*
  * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  * See LICENSE file for license details.
@@ -127,6 +126,8 @@ buttonpress(XEvent *e) {
                if(ev->x < x + bmw) {
                        if(ev->button == Button1)
                                togglemode(NULL);
+                       else if(ev->button == Button3)
+                               togglestackpos(NULL);
                }
        }
        else if((c = getclient(ev->window))) {
@@ -151,10 +152,8 @@ configurerequest(XEvent *e) {
        unsigned long newmask;
        Client *c;
        XConfigureRequestEvent *ev = &e->xconfigurerequest;
-       XEvent synev;
        XWindowChanges wc;
 
-       fputs("configurerequest\n", stderr);
        if((c = getclient(ev->window))) {
                c->ismax = False;
                gravitate(c, True);
@@ -179,8 +178,11 @@ configurerequest(XEvent *e) {
                else
                        configure(c);
                XSync(dpy, False);
-               if(c->isfloat)
+               if(c->isfloat) {
                        resize(c, False, TopLeft);
+                       if(!isvisible(c))
+                               ban(c);
+               }
                else
                        arrange(NULL);
        }
@@ -211,7 +213,6 @@ enternotify(XEvent *e) {
        Client *c;
        XCrossingEvent *ev = &e->xcrossing;
 
-       fputs("enternotify\n", stderr);
        if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
                return;
 
@@ -299,7 +300,6 @@ propertynotify(XEvent *e) {
        Window trans;
        XPropertyEvent *ev = &e->xproperty;
 
-       fputs("propertynotify\n", stderr);
        if(ev->state == PropertyDelete)
                return; /* ignore */
 
@@ -321,6 +321,7 @@ propertynotify(XEvent *e) {
                }
                if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
                        updatetitle(c);
+                       resizetitle(c);
                        drawtitle(c);
                }
        }