rules: don't select windows with no PID when looking for focus window

\#1322
This commit is contained in:
Łukasz Woźniak 2021-11-15 10:47:41 +01:00 committed by Peter F. Patel-Schneider
parent 4e8fb93b31
commit d33b407ba8
1 changed files with 1 additions and 1 deletions

View File

@ -288,7 +288,7 @@ def x11_focus_prog():
while window: while window:
pid = window.get_full_property(NET_WM_PID, 0) pid = window.get_full_property(NET_WM_PID, 0)
wm_class = window.get_wm_class() wm_class = window.get_wm_class()
if wm_class: if wm_class and pid:
break break
window = window.query_tree().parent window = window.query_tree().parent
name = psutil.Process(pid.value[0]).name() if pid else None name = psutil.Process(pid.value[0]).name() if pid else None