Help me with screen sharing on wayland

  • Can’t screen share on Discord (Flatpak) or record with OBS on Wayland (Guix System)

I’m extremely frustrated. I recently switched from Xmonad to Sway (Wayland) on Guix System, and now I cannot screen share on Discord (Flatpak) nor record my screen with OBS (Flatpak), even after installing all the required portal packages. I am already using PipeWire, so it’s not a missing service issue.

Environment

  • Distro: Guix System
  • Compositor: Sway (Wayland)
  • Discord: Flatpak
  • OBS Studio: Flatpak
  • Installed packages:
    #+BEGIN_SRC bash
    xdg-desktop-portal
    xdg-desktop-portal-gtk
    xdg-desktop-portal-wlr
    pipewire
    pipewire-pulse
    pipewire-media-session
    #+END_SRC
  • Using PipeWire for screen capture

Problem

  1. Discord (Flatpak):

    • When trying to share the screen, the screen/window selection either doesn’t appear or is just blank.
    • Flatpak permissions seem correct:
      #+BEGIN_SRC bash
      flatpak info --show-permissions com.discordapp.Discord
      #+END_SRC
  2. OBS (Flatpak):

    • Using Wayland capture sources (Screen Capture (PipeWire) / Window Capture (PipeWire)), nothing shows up or the screen is just black.

What I’ve tried

  • Installed all necessary portal packages via Guix:
    #+BEGIN_SRC bash
    guix install xdg-desktop-portal xdg-desktop-portal-gtk xdg-desktop-portal-wlr pipewire
    #+END_SRC
  • Restarted Sway session and Flatpak apps.
  • Verified that PipeWire and xdg-desktop-portal services are running:
    #+BEGIN_SRC bash
    ps aux | grep pipewire
    ps aux | grep xdg-desktop-portal
    #+END_SRC
  • Updated all Flatpak apps:
    #+BEGIN_SRC bash
    flatpak update
    #+END_SRC

Notes / Frustration

  • This never happened on X11 — everything worked perfectly before.
  • I feel like I traded stability for Wayland and now I can’t even screen share.
  • Seems like a known issue with PipeWire/xdg-desktop-portal on Wayland, especially with Sway or other wlroots-based compositors.

Question
Has anyone actually managed to get screen sharing on Discord Flatpak or OBS recording via PipeWire working on Wayland/Sway on Guix System? Any hidden configuration, patch, or magic incantation I’m missing here?

Yes, but every time someone mentions that removing X11 support is to early on the phoronix forums, a flame war starts :wink:

I had problems with xdg-desktop-portal on sway as well but this helped: [bug#73520] [PATCH 0/2] Potential fix for the latest xdg-desktop-portal

Not 100% which parts are actually required but these work for me:

Install xdg-desktop-portal and xdg-desktop-portal-wlr, have config file $HOME/.config/xdg-desktop-portal/sway-portals.conf:

[preferred]
org.freedesktop.impl.portal.Screenshot=wlr
org.freedesktop.impl.portal.ScreenCast=wlr

and run:

dbus-update-activation-environment XDG_CURRENT_DESKTOP=sway
dbus-update-activation-environment WAYLAND_DISPLAY
pkill xdg-desktop-portal

Last line is required if you have for example tried to share screen which starts xdg-desktop-portal.

Screen sharing can be tested here: gUM Test Page