Prevent crash if prev_focus.id is None

This commit is contained in:
John Mertz 2024-03-08 12:17:56 -07:00
parent 0eb58077e6
commit cd4af99566
1 changed files with 1 additions and 1 deletions

View File

@ -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)