-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit the ActivationToken
signal
#13
Comments
After a bit of investigation, generating an xdg activation token seems pretty complicated, and there's no good examples of it. It looks like we would have to interact with the wayland protocol, but I can't find any maintained haskell libraries for that. So I'm a little stuck on this. On another note, maybe #8 is also because we don't list the signals in our introspection thingy (mostly because I can't figure out how to) |
I think it's just the key |
I found this library: https://github.com/sivertb/wayland-wire. Although it's quite old and for some reason not on Hackage, it seems to do what we need. It takes an XML protocol specification and generates the corresponding Haskell bindings (using TemplateHaskell, which can do compile-time metaprogramming). The XML spec for the activation protocol should be https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/xdg-activation/xdg-activation-v1.xml. I haven't 100% understood yet how to use the library though. Also I'm not an wayland, so I can't really experiment with it either. Are you on wayland? We would also need to figure out whether X11 or Wayland is running, this seems to be the most promising approach for that. Alternatively we could use compile flags and Haskell's CPP extension, but that makes the build process more complicated and might become problematic if we eventually want to upload this package to the AUR or similar. This mentions some sort of interoperability with X11 tokens (which are easy to create), but I'm not sure if this implemented in every compositor. |
Hey! Unfortunately I switched over to AGS, so I won't be able to work on this anymore. Apologies :( |
The DBus notification specification includes this signal called
ActivationToken
which allows us to emit an activation token (Can be either an X11-style startup ID (see Startup notification protocol) or a Wayland xdg-activation token.)The intent is to emit this signal before emitting the ActionInvoked signal, which tells the window manager to hand off focus to the application which created the notification associated with the action. An example of how this works is with Firefox. Say we get a Discord notification. When we tell end to invoke the
default
action with that Discord notification. It will first emit theActivationToken
which will cause the window manager to switch workspaces and focus Firefox. Then we emit theActionInvoked
which Firefox will take and switch tabs to Discord.The text was updated successfully, but these errors were encountered: