From cd4af99566030ab200b6ff430d17d1e8e37598ba Mon Sep 17 00:00:00 2001 From: John Mertz Date: Fri, 8 Mar 2024 12:17:56 -0700 Subject: [PATCH] Prevent crash if prev_focus.id is None --- sway/sway-transparency.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sway/sway-transparency.py b/sway/sway-transparency.py index e153d8f..215ea14 100755 --- a/sway/sway-transparency.py +++ b/sway/sway-transparency.py @@ -30,7 +30,7 @@ def on_window_focus(opacity, ipc, event): focused = event.container workspace = focused_workspace.workspace().num - if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859 + if prev_focused.id and focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859 focused.command("opacity 1") if workspace == prev_workspace and not prev_focused.sticky: prev_focused.command("opacity " + opacity)