JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
OMG fix a 100 year old ryan bug that has been pissing me off since regions
authorMarco Peereboom <marco@conformal.com>
Wed, 30 Sep 2009 20:15:02 +0000 (20:15 +0000)
committerMarco Peereboom <marco@conformal.com>
Wed, 30 Sep 2009 20:15:02 +0000 (20:15 +0000)
got introduced and i pretended it was a quirk.

scrotwm.c

index a6aa81f..a4e3f61 100644 (file)
--- a/scrotwm.c
+++ b/scrotwm.c
@@ -1508,6 +1508,10 @@ stack_floater(struct ws_win *win, struct swm_region *r)
                wc.y = (HEIGHT(r) - win->g.h) / 2;
        }
 
+       /* adjust for region */
+       wc.x += r->g.x;
+       wc.y += r->g.y;
+
        DNPRINTF(SWM_D_STACK, "stack_floater: win %lu x %d y %d w %d h %d\n",
            win->id, wc.x, wc.y, wc.width, wc.height);
 
@@ -3257,14 +3261,18 @@ manage_window(Window id)
                ws = r->ws;
                /* this should launch transients in the same ws as parent */
                /* XXX doesn't work for intel xrandr */
-               if (id && trans) {
-                       if ((ww = find_window(trans)) != NULL) {
-                               ws = ww->ws;
-                               r = ws->r;
-                       }
-               }
+               if (id && trans)
+                       if ((ww = find_window(trans)) != NULL)
+                               if (ws->r) {
+                                       ws = ww->ws;
+                                       r = ww->ws->r;
+                               }
        }
 
+       /* shouldn't happen but does... */
+       if (ws->r == NULL)
+               ws->r = r; /* use found r since it isn't filled in */
+
        /* set up the window layout */
        win->id = id;
        win->ws = ws;