LizardByte / LizardByte/Sunshine

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

Open
#5,476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
41.4k
Forks
2.1k
Avg merge
23h 47m
Merged PRs (30d)
124

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the XDG Portal Grab (portalgrab) path that loads the saved portal_token and handles the RemoteDesktop Start response; use the provided logs to reproduce the no-streams case after a topology change. Done means an invalid token is discarded, a new permission flow is attempted, and display enumeration succeeds again.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.