From 7a679c3f01f453302229dc2530e7c5de9a1c2508 Mon Sep 17 00:00:00 2001
From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz>
Date: Fri, 21 Oct 2022 23:09:48 +0200
Subject: [PATCH] Small fixes

---
 woman/qt.py    | 5 +++--
 woman/watch.py | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/woman/qt.py b/woman/qt.py
index 42fdc8b..1e10d08 100755
--- a/woman/qt.py
+++ b/woman/qt.py
@@ -221,7 +221,7 @@ def qt_main():
                     target.put_in_new_container(None if new_container is True else new_container)
                 else:
                     target.wrap_if_is_root()
-                if expand and type(self) != I3InnerNodeWidget:
+                if expand and type(self) == I3InnerNodeWidget:
                     if before:
                         self.move(target, expand=True)
                         target.move(self.nodes[0])
@@ -475,6 +475,7 @@ def qt_main():
                         "tabbed": "stacked",
                         "stacked": "splith",
                         }.get(self.layout, "splith")
+            self.workspace_widget.screenshot_changed()
             shared.i3_cmd(f'[con_id={self.nodes[0].container_id}] layout {new_layout}')
             self.layout = new_layout
             self.redraw()
@@ -716,7 +717,7 @@ def qt_main():
             shared.i3_cmd(f'workspace {workspace(self.master, self.slave)}')
 
         def move_to_otput(self, output="next"):
-            shared.i3_cmd(f"move workspace to output {output}")
+            shared.i3_cmd(f"[workspace={workspace(self.master, self.slave)}] move workspace to output {output}")
 
         def move(self, target, swap=False, before=False, expand=False, new_container=None):
             if (w := self.root_i3_tree_widget()) is not None:
diff --git a/woman/watch.py b/woman/watch.py
index c859124..fd942dd 100644
--- a/woman/watch.py
+++ b/woman/watch.py
@@ -77,6 +77,7 @@ def i3_watch():
                 shared.output = e.current.ipc_data['output']
                 master, slave = parse_workspace(e.current.name)
                 event_workspace_is_on((master, slave), shared.output)
+                shared.qt_task("ws_metadata_changed", *shared.workspace_on[shared.output])
                 shared.workspace_on[shared.output] = (master, slave)
             return
         with shared.lock:
-- 
GitLab