Skip to content
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

GlobalShortcuts.BindShortcut unclear return value #1350

Open
dcz-self opened this issue Apr 26, 2024 · 1 comment
Open

GlobalShortcuts.BindShortcut unclear return value #1350

dcz-self opened this issue Apr 26, 2024 · 1 comment
Labels

Comments

@dcz-self
Copy link

Operating System

n/a

XDG Desktop Portal version

1.18

XDG Desktop Portal version (Other)

No response

Desktop Environment

Deepin

Desktop Environment (Other)

No response

Expected Behavior

The docs cover all the relevant use cases.

Current Behavior

Disabled shortcuts

BindShortcuts description says:

Each element of the shortcuts array returned by the org.freedesktop.portal.Request::Response signal is a tuple composed of a shortcut id, and a vardict with the following keys:

about the list, and pretty much nothing else. What's missing in particular is whether all shortcuts are expected to come back.

trigger_description (s)

User-readable text describing how to trigger the shortcut for the client to render.

is clearly meant for the application to communicate how to trigger the shortcut. What if the user decided to make the shortcut impossible to trigger? An application assuming that whatever comes back is set may end up printing "Press unset to trigger this", which is silly.
On the other hand, if skipped shortcuts are not present in the return value, the application may crash when trying to print a message("Press {} to trigger this", shortcuts["this"]).

Steps to Reproduce

  1. Read BindShortcuts description
  2. Try to understand the return value across different use cases

Anything else we should know?

No response

@dcz-self dcz-self added the bug label Apr 26, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Apr 26, 2024
@swick
Copy link
Contributor

swick commented Oct 9, 2024

I think the intention here is to send back the shortcuts that were bound which might be a subset, including an empty subset of the shortcuts which were passed in the shortcuts array.

KDE seems to have implemented this in a way that it returns as many entries as shortcuts were passed in. The frontend does not have this restriction.

It does make sense to me to clarify that a subset of shortcuts can be returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Triage
Development

No branches or pull requests

2 participants