-
Notifications
You must be signed in to change notification settings - Fork 0
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 activation tokens for X11 #4
Conversation
3db1359
to
2f5a69a
Compare
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.
I'll test it once we have issues resolved.
I've also rebased my branch, so it should be easier now.
2f5a69a
to
3acc71c
Compare
Random idea for that: libstartup-notification contains |
You could also test on alacritty if you have something that can pass startup notify. That's how I've done wayland testing ^ |
The utils in this module should help the users to activate the windows they create, as well as manage activation tokens environment variables. The API is essential for Wayland in the first place, since some compositors may decide initial focus of the window based on whether the activation token was during the window creation. Fixes rust-windowing#2279.
let atoms = self.xconn.atoms(); | ||
let title = { | ||
let title_bytes = self | ||
.xconn | ||
.get_property(self.xwindow, atoms[_NET_WM_NAME], atoms[UTF8_STRING]) | ||
.expect("Failed to get WM_NAME property"); | ||
|
||
String::from_utf8(title_bytes).map_err(|_| NotSupportedError::new())? | ||
}; |
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.
Don't we have a title()
getter already? I'm pretty sure you can just self.title()
.
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.
The title()
getter returns an empty string.
// Get the activation token and then put it in the event queue. | ||
let token = self | ||
.xconn | ||
.request_activation_token(&title) |
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.
Maybe we should request the token right before sending it back to the user?
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.
Good idea, I've implemented this.
@notgull I'm not sure whether we should really add this testing example, because it requires installing the desktop file. How were you testing it btw in your setup? |
CHANGELOG.md
if knowledge of this change could be valuable to userscc rust-windowing#2955
Adds the parallel activation context things to X11. None of this code has been tested.
It seems like the actual activation token from
request_activation_token
doesn't really matter, so I've just implemented it using the recommendation that the specs give.This is based on rust-windowing#2825, while the
activation_token
branch for this repo seems to be based on an older commit. Hence the extra noise.