From caab6fba5ce1ed723d07f18b28b85c77b11dddda Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Fri, 23 Mar 2018 23:16:40 +0100 Subject: [PATCH] gui_qt: fix possible crash on Linux If `_NET_ACTIVE_WINDOW` is not supported by the current window manager, then we can't track the currently focused window and should therefore not try to restore focus to it. --- plover/gui_qt/main_window.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plover/gui_qt/main_window.py b/plover/gui_qt/main_window.py index 8210d5d1a..ada0e36cf 100644 --- a/plover/gui_qt/main_window.py +++ b/plover/gui_qt/main_window.py @@ -169,7 +169,7 @@ def _activate_dialog(self, name, args=(), manage_windows=False): def on_finished(): del self._active_dialogs[name] dialog.deleteLater() - if manage_windows: + if manage_windows and previous_window is not None: wmctrl.SetForegroundWindow(previous_window) dialog.finished.connect(on_finished) dialog.show()