From df2352b39dacb4fc41960cc88f069a5d7f2f6d33 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Wed, 8 Jun 2011 22:36:44 +0000 Subject: [PATCH 1/1] when moving a transient also move the parent. --- scrotwm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- 1.7.10.4