[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bring within current tag



>>>>> On Tue, 10 Sep 2013 10:30:00 +0200, Gabor X Toth <*@tg-x.net> said:

> scoobertron pointed out that the bring command does not move clients within the
> current tag, the following patch fixes it.

seems like the attachment didn't get through, trying again..

-tg(x)
>From 5ef5048e91534d5d3deac06c843b13212c6dbb6b Mon Sep 17 00:00:00 2001
From: Gabor X Toth <*@tg-x.net>
Date: Tue, 10 Sep 2013 10:05:59 +0200
Subject: [PATCH] bring command: move client to current frame even within the
 current tag

---
 src/layout.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/layout.c b/src/layout.c
index f76705b..50d2eb4 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -929,7 +929,13 @@ int frame_current_bring(int argc, char** argv, GString* output) {
         }
         return HERBST_INVALID_ARGUMENT;
     }
-    tag_move_client(client, get_current_monitor()->tag);
+    HSTag *tag = get_current_monitor()->tag;
+    tag_move_client(client, tag);
+    HSFrame* frame = find_frame_with_client(tag->frame, client);
+    if (frame != g_cur_frame) {
+        frame_remove_client(frame, client);
+        frame_insert_client(g_cur_frame, client);
+    }
     focus_client(client, false, false);
     return 0;
 }
-- 
1.8.3.2