From 3a7e7f1831dd5d9c522e4afb3b954406996c9b4c Mon Sep 17 00:00:00 2001
From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz>
Date: Tue, 30 Aug 2022 21:08:24 +0200
Subject: [PATCH] Qt: On window quit redraw tree with delay

---
 woman/qt.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/woman/qt.py b/woman/qt.py
index 2cb0fbf..b0e9d4b 100755
--- a/woman/qt.py
+++ b/woman/qt.py
@@ -912,6 +912,11 @@ def qt_main():
                 for w in self._workspaces.values():
                     w._tree.find(self.find_regex)
 
+        @QtJobDecorator
+        async def wait_and_load_i3_tree(self, time_ms):
+            await qt_job_wait_ms(time_ms)
+            self.load_i3_tree()
+
         def set_screenshot_size(self, val):
             self.screenshot_size = val
             for i in self._workspaces.values():
@@ -1258,6 +1263,7 @@ def qt_main():
                             if key == ord("Y") and mod in [0, SHIFT]:
                                 nd.quit_windows()
                                 self.load_i3_tree()
+                                self.wait_and_load_i3_tree(100)
                             else:
                                 raise NoSutchKey(key, mod)
                         elif mod == 0 and key == ord('K'):
@@ -1265,6 +1271,7 @@ def qt_main():
                             if key == ord("Y") and mod in [SHIFT]:
                                 nd.quit_windows(force=True)
                                 self.load_i3_tree()
+                                self.wait_and_load_i3_tree(100)
                             else:
                                 raise NoSutchKey(key, mod)
                         else:
-- 
GitLab