Skip to content

panel/menu: launch apps with a valid xdg-activation token #293

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dkondor
Copy link
Contributor

@dkondor dkondor commented Apr 13, 2025

Creating a Gdk::AppLaunchContext from the current display and providing it to Gio::AppInfo::launch() takes care of this.

This can be useful if a compositor is set not to focus newly created toplevels without a valid xdg-activation token (see WayfireWM/wayfire#2627)

Creating a Gdk::AppLaunchContext from the current display and providing it to Gio::AppInfo::launch() takes care of this.
@trigg
Copy link
Contributor

trigg commented Apr 20, 2025

I've tested this and it works as expected, The same can be said for equivalent changes to the gtk4 branch I have, so I'm going to apply this there too.

trigg added a commit to trigg/wf-shell that referenced this pull request Apr 20, 2025
@NamorNiradnug
Copy link
Collaborator

Shouldn't similar changes also be applied for panel/launchers?

@dkondor
Copy link
Contributor Author

dkondor commented Apr 21, 2025

Shouldn't similar changes also be applied for panel/launchers?

Actually yes :)

I've added an implementation, but it is not working. My hunch is that since the panel does not get keyboard focus, generating a token runs into some problem. Running with WAYLAND_DEBUG, it seems to me that the issue is on the GTK side:

[4077976.332] {Default Queue} wl_pointer#18.button(79, 44445793, 272, 1)
[4077976.367] {Default Queue} wl_pointer#18.frame()

...

[4078003.170] {Default Queue}  -> xdg_activation_v1#20.get_activation_token(new id xdg_activation_token_v1#48)
[4078003.186]  -> xdg_activation_token_v1#48.set_serial(79, wl_seat#21)
[4078003.198]  -> xdg_activation_token_v1#48.commit()
[4078003.446] xdg_activation_token_v1#48.done("4e637e06f95345fa497278d8f4fe51f0")
[4078003.474]  -> xdg_activation_token_v1#48.destroy()

For some reason, the panel's surface is not set -- compare this to the case of using the menu:

[4202341.600] {Default Queue} wl_pointer#18.button(140, 44570159, 272, 1)
[4202341.686] {Default Queue} wl_pointer#18.frame()

...

[4202404.193] {Default Queue}  -> xdg_activation_v1#20.get_activation_token(new id xdg_activation_token_v1#51)
[4202404.206]  -> xdg_activation_token_v1#51.set_serial(140, wl_seat#21)
[4202404.215]  -> xdg_activation_token_v1#51.set_surface(wl_surface#38)
[4202404.220]  -> xdg_activation_token_v1#51.commit()
[4202404.349] xdg_activation_token_v1#51.done("67014538372d68f7958e1a7d441c6d58")
[4202404.370]  -> xdg_activation_token_v1#51.destroy()

which works well.

(note: this is with setting the check_surface = true option from WayfireWM/wayfire#2527)

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.

3 participants