mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 06:46:27 -04:00
contrib/inactive-windows-transparency: remove all transparencies on exit
Hidden windows in the scratchpad failed to have their transparency reset upon program exit. This is because they are kept separetly in `ipc.get_tree.scratchpad()`, and not in `ipc.get_tree.workspaces()`.
This commit is contained in:
parent
78b5c0a77e
commit
10c697d33a
1 changed files with 7 additions and 4 deletions
|
|
@ -32,9 +32,12 @@ def on_window_focus(inactive_opacity, ipc, event):
|
|||
|
||||
|
||||
def remove_opacity(ipc):
|
||||
for workspace in ipc.get_tree().workspaces():
|
||||
for w in workspace:
|
||||
w.command("opacity 1")
|
||||
tree = ipc.get_tree()
|
||||
for workspace in tree.workspaces():
|
||||
for window in workspace:
|
||||
window.command("opacity 1")
|
||||
for window in tree.scratchpad():
|
||||
window.command("opacity 1")
|
||||
ipc.main_quit()
|
||||
sys.exit(0)
|
||||
|
||||
|
|
@ -66,4 +69,4 @@ if __name__ == "__main__":
|
|||
for sig in [signal.SIGINT, signal.SIGTERM]:
|
||||
signal.signal(sig, lambda signal, frame: remove_opacity(ipc))
|
||||
ipc.on("window::focus", partial(on_window_focus, args.opacity))
|
||||
ipc.main()
|
||||
ipc.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue