From 90752c586fc6b94e9b09843908b23b92862a0af9 Mon Sep 17 00:00:00 2001 From: Ron Friedman Date: Tue, 2 Sep 2025 19:39:05 -0700 Subject: [PATCH] Fix freeze when triggering window switcher --- __init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 80072c6..8a3e80b 100644 --- a/__init__.py +++ b/__init__.py @@ -33,6 +33,7 @@ def defaultTrigger(self): return 'w ' def handleTriggerQuery(self, query): + results = [] try: for line in subprocess.check_output(['wmctrl', '-l', '-x']).splitlines(): win = Window(*parseWindow(line)) @@ -44,7 +45,7 @@ def handleTriggerQuery(self, query): m = Matcher(query.string) if not query.string or m.match(win_instance + ' ' + win_class + ' ' + win.wm_name): - query.add(StandardItem( + results.append(StandardItem( id="%s%s" % (md_name, win.wm_class), iconUrls=["xdg:%s" % win_instance], text="%s - Desktop %s" % (win_class.replace('-', ' '), win.desktop), @@ -61,7 +62,7 @@ def handleTriggerQuery(self, query): )) except subprocess.CalledProcessError as e: warning(f"Error executing wmctrl: {str(e)}") - + query.add(results) def parseWindow(line): win_id, desktop, rest = line.decode().split(None, 2)