X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=78f5af73247ac0311519e2701f72bda65eb196c8;hb=df2352b39dacb4fc41960cc88f069a5d7f2f6d33;hp=4793b6a223064ade40e8213dbc338fdce4cdf273;hpb=698b4e7f49a278244ec4a774f79378b640be90ca;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index 4793b6a..78f5af7 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -2875,7 +2875,7 @@ void send_to_ws(struct swm_region *r, union arg *args) { int wsid = args->id; - struct ws_win *win = win; + struct ws_win *win = NULL, *parent; struct workspace *ws, *nws; Atom ws_idx_atom = 0; unsigned char ws_idx_str[SWM_PROPLEN]; @@ -2897,6 +2897,15 @@ send_to_ws(struct swm_region *r, union arg *args) a.id = SWM_ARG_ID_FOCUSPREV; focus(r, &a); + if (win->transient) { + parent = find_window(win->transient); + if (parent) { + unmap_window(parent); + TAILQ_REMOVE(&ws->winlist, parent, entry); + TAILQ_INSERT_TAIL(&nws->winlist, parent, entry); + parent->ws = nws; + } + } unmap_window(win); TAILQ_REMOVE(&ws->winlist, win, entry); TAILQ_INSERT_TAIL(&nws->winlist, win, entry);