mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-31 00:05:13 +02:00
i3-companion: ensure variables are captured when wrapping event
This commit is contained in:
parent
83ba6b5a23
commit
d56b44114a
1 changed files with 11 additions and 9 deletions
|
@ -456,21 +456,23 @@ async def main(options):
|
|||
if isinstance(event, DBusSignal):
|
||||
for bus in {i3.session_bus, i3.system_bus}:
|
||||
|
||||
@ravel.signal(
|
||||
name=event.member,
|
||||
in_signature=event.signature,
|
||||
path_keyword="path",
|
||||
args_keyword="args",
|
||||
)
|
||||
async def wrapped(path, args):
|
||||
return await fn(i3, event, path, *args)
|
||||
def wrapping(fn, event):
|
||||
@ravel.signal(
|
||||
name=event.member,
|
||||
in_signature=event.signature,
|
||||
path_keyword="path",
|
||||
args_keyword="args",
|
||||
)
|
||||
async def wrapped(path, args):
|
||||
return await fn(i3, event, path, *args)
|
||||
return wrapped
|
||||
|
||||
bus.listen_signal(
|
||||
path=event.path,
|
||||
fallback=True,
|
||||
interface=event.interface,
|
||||
name=event.member,
|
||||
func=wrapped,
|
||||
func=wrapping(fn, event),
|
||||
)
|
||||
|
||||
await i3.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue