Skip to content

Unable to exit steam games using steam overlay when launched as shortcuts from ES #15602

@ImanolBarba

Description

@ImanolBarba

Batocera build version

43 2026/03/22 11:59

Your architecture

x86-64-v3

Your Graphic Processor Unit(s) (GPU)

Reproducible with AMD 7900 XTX and Steam deck APU

Issue description

When you install games on Steam, it drops shortcuts:

[root@BATOCERA ~]# cat ../roms/steam/Balatro.steam
steam://rungameid/2379780

Launching these starts the game, and everything seems to work fine, until you attempt to exit the game via Steam Overlay "Exit Game" option. The game keeps running, you lose input, and Steam believes the game has exited (but continues to run in the screen).

Exiting via Alt+F4 or the game's own option to exit avoids the issue, but if the above has been attempted, even the game's own option to exit does not work.

I think the steam overlay's Exit Game option targets some wrapper instead of the game itself and the signal is not propagated, but I haven't looked into it in depth

Detailed reproduction steps

Steps

  1. Install steam via flatpak
  2. Open steam and install a random game. I've been able to repro with all, but I use balatro
  3. Press the Xbox button, steam button, shift+tab or whatever brings the steam overlay (big picture or regular, don't matter).
  4. Select Exit Game
  5. Game does not exit
  6. Game is responsive, but input does not work
  7. Alt+F4 closes the game and ES returns successfully
  • Exiting the game via the own game's exit button or whatever it has, works normally, but only if the user hasn't attempted the process above.
  • Reproducible with both x86-64 and x86-64-v3 builds, haven't tried any other
  • Opening the steam flatpak in the "Ports" category from ES, and then closing any launched games in the same manner does not reproduce the bug: the game closes correctly.

Details of any attempts to fix this yourself

Not much really since I haven't figured out what's happening yet

Details of any modifications you have made to Batocera.

  • rootfs is unchanged
  • /userdata formatted as btrfs, unsure if reproducible with ext4
  • /userdata/saves is an NFS share, and because steam and the games it installs live in /userdata/saves/flatpak and I wanted steam games to stay local, I created a service to put a bind mount on top:
[root@BATOCERA ~]# cat services/flatpak_mount
#!/bin/bash

MOUNT_SRC="/userdata/local_flatpak"
MOUNT_DST="/userdata/saves/flatpak"

# Function to check if the destination is currently a mount point
check_mounted() {
    grep -qs "${MOUNT_DST}" /proc/mounts
}

case "$1" in
    start)
        if check_mounted; then
            echo "Start aborted: ${MOUNT_DST} is already mounted."
            exit 1
        fi

        mkdir -p "${MOUNT_SRC}"
        mount --bind "${MOUNT_SRC}" "${MOUNT_DST}"
        echo "Started: Mounted ${MOUNT_SRC} to ${MOUNT_DST}."
        ;;

    stop)
        if ! check_mounted; then
            echo "Stop aborted: ${MOUNT_DST} is not currently mounted."
            exit 1
        fi

        umount "${MOUNT_DST}"
        echo "Stopped: Unmounted ${MOUNT_DST}."
        ;;

    status)
        if check_mounted; then
            echo "Status: MOUNTED"
            exit 0
        else
            echo "Status: UNMOUNTED"
            exit 3
        fi
        ;;

    *)
        echo "Usage: $0 {start|stop|status}"
        exit 1
        ;;
esac

exit 0

Seems to work fine

[root@BATOCERA ~]# mount | grep flatpak
/dev/sda2 on /userdata/saves/flatpak type btrfs (rw,noatime,compress-force=zstd:3,space_cache=v2,autodefrag,subvolid=5,subvol=/)
[root@BATOCERA ~]# ls -lhatr /userdata/saves/flatpak/
total 9.0K
drwxr-xr-x  1 root root 46 Mar 18 18:20 data
drwxr-xr-x  1 root root 92 Mar 18 20:03 binaries
drwxr-xr-x 38 root root 40 Mar 22 23:36 ..
drwxr-xr-x  1 root root 24 Mar 23 17:06 .

Logs and data

logs.tar.gz

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