From: Marco Peereboom Date: Wed, 30 Sep 2009 20:15:02 +0000 (+0000) Subject: OMG fix a 100 year old ryan bug that has been pissing me off since regions X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=3b1be00edc0e9237804e9a1c24399dd2613c163f;p=spectrwm.git OMG fix a 100 year old ryan bug that has been pissing me off since regions got introduced and i pretended it was a quirk. --- diff --git a/scrotwm.c b/scrotwm.c index a6aa81f..a4e3f61 100644 --- 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;