xdg_activation_v1 not working with popovers
Steps to reproduce
- Open GNOME Text Editor
- Open Nautilus
- Open a file in GNOME Text Editor via the context menu -> Open with Text Editor
Current behavior
GNOME Shell shows a "Text Editor is ready" notification
Expected outcome
Text Editor gets focus
Version information
- GTK 4.10.1
- GNOME Shell 44.0 with 44.0 applications
- NixOS unstable
Additional information
I did some debugging and this is caused by GTK chosing not to pass a surface to the xdg_activation_v1 interface here.
Basically since the click is done in a popover, wl_surface is NULL (probably because gdk_wayland_device_get_focus
returns NULL).
This causes Mutter to reject the activation here as it requires both seat and surface to be present to consider the activation safe to perform.
Tagging @carlosg as you did most of the implementation on both sides.