hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.25k stars 802 forks source link

Implement xdg-foreign v1 & v2 protocols #6884

Open DerpDays opened 1 month ago

DerpDays commented 1 month ago

Description

It would be nice the xdg-foreign protocol was supported.

It can be used when binding global shortcuts to the xdg desktop portal (which i'm assuming would allow for the shortcuts to be unbound when the surface they are binded to is destroyed - not sure about this though). Without the protocol we can only pass an empty string when binding global shortcuts.

Doesn't affect the ability to bind global shortcuts since we can just pass an empty string, so it's just something nice to have.

I'm also not sure how to properly set the shortcut app name since when I create a shortcut with an id, to bind the keybind in hyprland I have to use :id instead of app:id as described in the wiki, so I'm assuming the app id is most likely meant to be related to surface that bound the global keybinds (which I can only set to an empty string) from it's corresponding layer namespace or app id - please correct me if I'm wrong though.

Related links about this: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-bindshortcuts https://flatpak.github.io/xdg-desktop-portal/docs/window-identifiers.html

vaxerski commented 1 month ago

app can be any string, it's just used for easier identification by the user and avoiding collisions.

DerpDays commented 1 month ago

Does the appid come from the options passed when creating the session then or is it somewhere else I've missed? I've taken a look at xdph but since I'm unfamiliar with c++ I'm unsure how the appid is extracted from sdbus::MethodCall.

vaxerski commented 1 month ago

if XDPH is registering, it comes from here: https://github.com/hyprwm/xdg-desktop-portal-hyprland/blob/b9b97e5ba23fe7bd5fa4df54696102e8aa863cf6/src/portals/GlobalShortcuts.cpp#L41-L42