From bee46da36550e65529c600e7cbed7206e1f21907 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 30 Jul 2021 15:41:20 +0200 Subject: [PATCH] i3-companion: handle windows without a workspace --- bin/i3-companion | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/i3-companion b/bin/i3-companion index 3b6c2bd..50a91d9 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -375,7 +375,10 @@ async def workspace_exclusive(i3, event): if current_window is None: logger.debug("cannot find new window in tree?") return - current_workspace = current_window.workspace().num + current_workspace = current_window.workspace() + if current_workspace is None: + logger.debug("cannot find new window workspace?") + return # Get the list of workspaces with an exclusive app, excluding the # current window and windows of the same class. @@ -388,7 +391,7 @@ async def workspace_exclusive(i3, event): } # If current one is OK, don't move - if current_workspace not in exclusive_workspaces: + if current_workspace.num not in exclusive_workspaces: logger.debug("no exclusive app, %s can go there", w.window_class) return