]> code.delx.au - spectrwm/commitdiff
when moving a transient also move the parent.
authorMarco Peereboom <marco@conformal.com>
Wed, 8 Jun 2011 22:36:44 +0000 (22:36 +0000)
committerMarco Peereboom <marco@conformal.com>
Wed, 8 Jun 2011 22:36:44 +0000 (22:36 +0000)
scrotwm.c

index 4793b6a223064ade40e8213dbc338fdce4cdf273..78f5af73247ac0311519e2701f72bda65eb196c8 100644 (file)
--- 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);