Skip to content
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

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Implement xdg_activation_v1 #432

merged 1 commit into from
Jun 10, 2024

Conversation

pcc
Copy link
Contributor

@pcc pcc commented Jun 10, 2024

Fixes #30.

Copy link
Owner

@YaLTeR YaLTeR left a 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);
}
}
}
Copy link
Owner

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.

Copy link
Contributor Author

@pcc pcc Jun 10, 2024

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.

Copy link
Owner

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

Copy link
Contributor Author

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.

@YaLTeR YaLTeR enabled auto-merge (rebase) June 10, 2024 15:01
@YaLTeR
Copy link
Owner

YaLTeR commented Jun 10, 2024

Thanks! I'll probably make the workspace switch animated but I can do it myself.

@YaLTeR YaLTeR merged commit bc3d6ca into YaLTeR:main Jun 10, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add xdg_activation support
2 participants