From dcad9cfbd3e79af42eedb03df11c4372f803d530 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 23 Jul 2021 11:19:50 +0200 Subject: [PATCH] i3-companion: handle windows disappearing too fast --- bin/i3-companion | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/i3-companion b/bin/i3-companion index 8b0baa3..0229dd2 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -352,7 +352,11 @@ async def workspace_exclusive(i3, event): # Get the window workspace. From an event, w.workspace() is None, # so search it in the tree. - current_workspace = tree.find_by_id(w.id).workspace().num + current_window = tree.find_by_id(w.id) + if current_window is None: + logger.debug("cannot find new window in tree?") + return + current_workspace = current_window.workspace().num # Get the list of workspaces with an exclusive app, excluding the # current window and windows of the same class.