-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Implement xdg_activation_v1 #432
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just needs token validation implemented.
self.niri.layout.activate_window(&window); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, every token is considered valid, however that's not what we want. We want to override token_created()
to check if the serial is valid. Tokens without serial should be urgent-only (we don't have the concept, but we will eventually, so just put a bool somewhere), and tokens with an invalid serial should be ignored.
Here's the cosmic-comp impl for reference: https://github.com/pop-os/cosmic-comp/blob/b5dcec521505c1486ff91bde3558d99c4f03e5ae/src/wayland/handlers/xdg_activation.rs#L25
We don't have privileged clients so you can ignore that part, but the rest seems relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, but how about we don't track urgent-only for now and just return false from token_created
to invalidate the token if we don't consider it valid (i.e. created without serial or while not focused). The code can always be adjusted when urgent activation is implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this doesn't upset the clients, sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I tested my token_created
implementation with Kitty activating a Chrome tab via URL open and it worked fine.
Thanks! I'll probably make the workspace switch animated but I can do it myself. |
Fixes #30.