Skip to content

Conversation

@gdesmott
Copy link

@gdesmott gdesmott commented Jan 4, 2026

Description

A couple of changes ensuring the service is properly started after graphical-session.target.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

xdg-desktop-autostart is not active on Fedora with GNOME.
Fix "Error reading events from display: Broken pipe" when starting if
the display is not ready yet.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 4, 2026

@ReenigneArcher
Copy link
Member

I think we actually need a way to handle different environments... because this file just keeps getting changed back and forth.

https://github.com/LizardByte/Sunshine/commits/92b4eeee55002395ef4d6adc244e357c1eb7bc9f/sunshine.service.in?browsing_rename_history=true&new_path=packaging/linux/sunshine.service.in&original_branch=master

@gdesmott
Copy link
Author

gdesmott commented Jan 5, 2026

I'm not an expert but as I understand it graphical-session.target is a better fit as not all desktop environment will enable xdg-desktop-autostart while graphical-session.target is just Wayland itself.

Is there any setup where xdg-desktop-autostart is enabled but graphical-session.target is not?

@ReenigneArcher
Copy link
Member

I am not an expert either, but we do need to handle non wayland environments.

I found this (https://systemd.io/DESKTOP_ENVIRONMENTS/), maybe it has some answers.

@psyke83
Copy link
Contributor

psyke83 commented Jan 24, 2026

I think xdg-desktop-autostart fits better because it is started by (and thus after) graphical-session. My understanding of the distinction is that graphical-session will cover initialization of low-level services needed to start a graphical session such as Xorg and wayland compositors, whereas xdg-desktop-autostart is focused on apps to be started within the actual graphical session. Sunshine should be treated more like the latter than former because we depend on the graphical session first being initialized in order for capture initialization to work.

What distro(s) are not shipping xdg-desktop-autostart? Perhaps the addition of "After=graphical-session.target" might be an acceptable middle-ground if this really is an issue with some distributions (and thus you will have to depend on the 5 second delay in the service file to hope that your graphical session actually finishes loading before sunshine initialization starts), but I agree with @ReenigneArcher that changing the base xdg-desktop-autostart dependency is wrong.

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.

3 participants