Skip to content

fix: propagate desktop portal request errors to avoid startup hang on KDE Wayland#1413

Merged
Schneegans merged 1 commit into
kando-menu:mainfrom
Branrir:fix-1412
Jun 14, 2026
Merged

fix: propagate desktop portal request errors to avoid startup hang on KDE Wayland#1413
Schneegans merged 1 commit into
kando-menu:mainfrom
Branrir:fix-1412

Conversation

@Branrir

@Branrir Branrir commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Problem

On KDE Plasma Wayland, Kando fails to start. xdg-desktop-portal-kde rejects the global-shortcuts CreateSession call with DBusError: An app id is required, producing an unhandled promise rejection and hanging the app during initialization:

(node:13350) UnhandledPromiseRejectionWarning: DBusError: An app id is required

Root cause

In makeRequest (desktop-portal.ts), the callback fired the D-Bus call (e.g. CreateSession) but ignored the returned promise. When the portal rejected instead of replying with a Response signal, the error was never propagated — so makeRequest waited forever, hanging isAvailable() → init() and never opening the window. The try/catch in connectImpl meant to handle this never got the chance to fire.

Fix

  • makeRequest now propagates the underlying D-Bus call's rejection (and removes its message listener) instead of waiting indefinitely.
  • The portal callbacks in global-shortcuts.ts and remote-desktop.ts now return their D-Bus call promises so rejections reach makeRequest.

With this, a failed portal request rejects cleanly, connectImpl's catch runs, and the KDE backend falls back to its KWin-scripting method as intended — the app starts normally.

Testing

  • npm run tscheck, eslint, and prettier all pass.
  • Verified Kando launches on KDE Plasma Wayland.

Related issue
#1412

@Branrir Branrir marked this pull request as draft June 13, 2026 21:47
@Branrir Branrir marked this pull request as ready for review June 13, 2026 21:51
@Branrir Branrir marked this pull request as draft June 13, 2026 21:52
@Branrir Branrir marked this pull request as ready for review June 13, 2026 22:05
@Schneegans

Copy link
Copy Markdown
Contributor

Thanks a lot! Maybe we can even fix the root cause for this (I added a comment in #1412). Yet I'll merge this anyways since it seems to be a good idea 😄

@Schneegans Schneegans merged commit 0f81a15 into kando-menu:main Jun 14, 2026
11 checks passed
@Branrir Branrir deleted the fix-1412 branch June 14, 2026 03:58
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.

2 participants