From: Marco Peereboom Date: Wed, 8 Jun 2011 22:36:44 +0000 (+0000) Subject: when moving a transient also move the parent. X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=df2352b39dacb4fc41960cc88f069a5d7f2f6d33;hp=698b4e7f49a278244ec4a774f79378b640be90ca;p=spectrwm.git when moving a transient also move the parent. --- 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);