Skip to content

Can't find any displays after topology change due to stale portal_token #5476

Description

@c0y0t3d3n

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

flatpack uses XDG Portal Grab, and if the display topology changes (switching connected monitor from integrated to discrete GPU, to different DisplayPort, or if GNOME Remote Desktop is used, etc..) the portal_token saved when Remote Desktop permission is granted will no longer be valid. Sunshine does not delete the portal token and try to obtain a new one when this happens, it simply fails to find any displays.

Expected Behavior

if portal_token is invalid, delete it and start over. This will pop the Remote Desktop permission dialog and if allowed will save a new portal_token.

Additional Context

No response

Host Operating System

Linux

Operating System Version

Ubuntu 26.04

Architecture

amd64/x86_64

Package

Linux - flathub/flatpak

GPU Type

NVIDIA

GPU Model

GTX 1660 (TU116) / Intel UHD

GPU Driver/Mesa Version

Nvidia 595.84 / Mesa 26.1.5

Capture Method

XDG Portal Grab (FreeBSD/Linux)

Apps

Log output

after the token has been invalidated by changing monitor topology or using Gnome Remote Desktop:
[2026-08-05 12:39:20.680]: Info: [portalgrab] Loaded portal restore token from disk
[2026-08-05 12:39:20.708]: Error: [portalgrab] RemoteDesktop Start: no streams in response
[2026-08-05 12:39:20.708]: Warning: [portalgrab] Failed to connect to portal. Cannot enumerate displays, returning empty list.
[2026-08-05 12:39:20.715]: Error: Unable to initialize capture method
[2026-08-05 12:39:20.715]: Error: Platform failed to initialize

after deleting ~/.var/app/dev.lizardbyte.app.Sunshine/config/sunshine/portal_token, restarting Sunshine, and allowing Remote Desktop again:
[2026-08-05 12:40:43.220]: Info: [portalgrab] Saved portal restore token to disk
[2026-08-05 12:40:43.220]: Info: [wayland] Found display [wayland-0]
[2026-08-05 12:40:43.220]: Info: [wayland] Found interface: wl_output(5) version 4
[2026-08-05 12:40:43.220]: Info: [wayland] Found interface: zxdg_output_manager_v1(6) version 3
[2026-08-05 12:40:43.220]: Info: [wayland] Found interface: zwp_linux_dmabuf_v1(25) version 5
[2026-08-05 12:40:43.220]: Info: [wayland] Resolution: 2560x1440
[2026-08-05 12:40:43.220]: Info: [wayland] Offset: 0x0
[2026-08-05 12:40:43.220]: Info: [wayland] Logical size: 2560x1440
[2026-08-05 12:40:43.220]: Info: [wayland] Name: DP-2
[2026-08-05 12:40:43.220]: Info: [wayland] Found monitor: Dell Inc. 27"
[2026-08-05 12:40:43.223]: Info: [portalgrab] Found stream for display id/name: 'DP-2' position: 0x0 resolution: 2560x1440

Online logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions