Prevent inactive-windows-transparency.py to crash on lockscreen
This commit is contained in:
parent
42cbaf278c
commit
a3d45c3280
|
@ -15,8 +15,13 @@ def on_window_focus(inactive_opacity, ipc, event):
|
||||||
global prev_focused
|
global prev_focused
|
||||||
global prev_workspace
|
global prev_workspace
|
||||||
|
|
||||||
|
focused_workspace = ipc.get_tree().find_focused()
|
||||||
|
|
||||||
|
if focused_workspace == None:
|
||||||
|
return
|
||||||
|
|
||||||
focused = event.container
|
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
|
if focused.id != prev_focused.id: # https://github.com/swaywm/sway/issues/2859
|
||||||
focused.command("opacity 1")
|
focused.command("opacity 1")
|
||||||
|
|
Loading…
Reference in a new issue