Skip to content

Commit

Permalink
Prevent inactive-windows-transparency.py to crash on lockscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
palb91 authored and emersion committed Feb 16, 2021
1 parent 42cbaf2 commit a3d45c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contrib/inactive-windows-transparency.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ def on_window_focus(inactive_opacity, ipc, event):
global prev_focused
global prev_workspace

focused_workspace = ipc.get_tree().find_focused()

if focused_workspace == None:
return

focused = event.container
workspace = ipc.get_tree().find_focused().workspace().num
workspace = focused_workspace.workspace().num

if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859
focused.command("opacity 1")
Expand Down

0 comments on commit a3d45c3

Please sign in to comment.