-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
wayland: Implement RaiseWindow with xdg-activation #4413
Conversation
app_name = "SDL Application"; | ||
} | ||
|
||
xdg_activation_token_v1_set_surface(wind->activation_token, wind->surface); |
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 possible, call xdg_activation_token_v1_set_serial
with the seat+serial of the event (e.g. click or key press) that triggered the activation. Some compositors might only raise toplevels if they do this.
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.
Added a note regarding the serial - this call is technically arbitrary and not based on reactions to any events, so we won't have a serial readily available. That said, it's okay if this gets mostly ignored, especially since it's arbitrary.
c639630
to
57d1946
Compare
Would be useful to also call "activate(token)" with the token from the corresponding env var, if set, to make sure the SDL application gets focused correctly on startup. |
I was able to build sway locally and can confirm the latest works as intended!
Is there a specific place we should do this? I wasn't able to find any existing examples for this. |
When creating the |
Nice, this PR looks pretty good to me! |
Latest commit now checks for XDG_ACTIVATION_TOKEN, re-tested on sway and everything looked okay - @jadahl, as long as the added commit looks good to you this is ready to go! |
Something like that. Seems we did an awful job at specifying when exactly it should be called. |
913ed06
to
4f1685a
Compare
4f1685a
to
4478c3c
Compare
This is a draft of Wayland RaiseWindow support - I say "draft" because I have no way of testing to make sure this works. Will mark as ready to merge once that's done.
Other than that, there's not much to see - the protocol implements window raising as an "activation token" which we send to the compositor and it may or may not honor our request depending on how it feels. Worst case it makes our window blink in the taskbar instead of actually raising it, which is better than nothing I suppose.
Test is here. Use
./run.sh
to run with Wayland, alt-tab to a different window, and in 3 seconds the RaiseWindow call should occur.