Subject: gnome-shell: Display never turns off at lock screen when running SDL2 (GNOME on Xorg)

From: Eric Li <[email-masked]>
Date: Wed, 08 Nov 2023 20:03:23 -0800

Package: gnome-shell
Version: 43.6-1~deb12u2
Severity: normal
X-Debbugs-Cc: [email-masked]

I am using GNOME on Xorg. Normally, when I lock the screen, the display will
be turned off. Only when I move the mouse / press the keyboard, the display
will turn back on.

However, when I am running a SDL2 application and lock the screen, the display
turns off at first. However, after less than 1 minute, the display turns on by
itself. The display stays on even after waiting for a few minutes.

Way to reproduce (demo video: <https://youtu.be/Tfs2amLXogI>):

1. Switch to "GNOME on Xorg", the default for Debian is Wayland.
2. Open an SDL2 application. For example this bug is reproducible using
<https://gitlab.com/aminosbh/basic-c-sdl-game>. Can also reproduce this problem
using PPSSPP. My SDL version is 2.26.5.
3. Lock the screen using Super+L. See that the display is turned off.
4. Wait for a few minutes, notice that the display is turned on, even without
any user input. The display stays on forever.

Expected behavior:

4. The display should be off when there is no user input. (This is the behavior
of GNOME on Wayland).

Workaround: Use SDL_VIDEO_ALLOW_SCREENSAVER=1 to prevent SDL2 from disabling
screensaver.

Note: this bug is previously reported to SDL at <https://github.com/libsdl-
org/SDL/issues/8443>, but is considered likely a bug of GNOME.

-- System Information:
Debian Release: 12.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-13-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=zh_CN.UTF-8, LC_CTYPE=zh_CN.UTF-8 (charmap=UTF-8), LANGUAGE=zh_CN:zh
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gnome-shell depends on:
ii  dconf-gsettings-backend [gsettings-backend]  0.40.0-4
ii  gir1.2-accountsservice-1.0                   22.08.8-6
ii  gir1.2-adw-1                                 1.2.2-1
ii  gir1.2-atk-1.0                               2.46.0-5
ii  gir1.2-atspi-2.0                             2.46.0-5
ii  gir1.2-freedesktop                           1.74.0-3
ii  gir1.2-gcr-3                                 3.41.1-1+b1
ii  gir1.2-gdesktopenums-3.0                     43.0-1
ii  gir1.2-gdkpixbuf-2.0                         2.42.10+dfsg-1+b1
ii  gir1.2-gdm-1.0                               43.0-3
ii  gir1.2-geoclue-2.0                           2.6.0-2
ii  gir1.2-glib-2.0                              1.74.0-3
ii  gir1.2-gnomebluetooth-3.0                    42.5-3
ii  gir1.2-gnomedesktop-3.0                      43.2-2
ii  gir1.2-graphene-1.0                          1.10.8-1
ii  gir1.2-gstreamer-1.0                         1.22.0-2
ii  gir1.2-gtk-3.0                               3.24.38-2~deb12u1
ii  gir1.2-gtk-4.0                               4.8.3+ds-2+deb12u1
ii  gir1.2-gweather-4.0                          4.2.0-2
ii  gir1.2-ibus-1.0                              1.5.27-5
ii  gir1.2-mutter-11                             43.6-1~deb12u1
ii  gir1.2-nm-1.0                                1.42.4-1
ii  gir1.2-nma-1.0                               1.10.6-1
ii  gir1.2-pango-1.0                             1.50.12+ds-1
ii  gir1.2-polkit-1.0                            122-3
ii  gir1.2-rsvg-2.0                              2.54.7+dfsg-1~deb12u1
ii  gir1.2-soup-3.0                              3.2.2-2
ii  gir1.2-upowerglib-1.0                        0.99.20-2
ii  gir1.2-webkit2-4.1                           2.42.1-1~deb12u1
ii  gnome-backgrounds                            43.1-1
ii  gnome-settings-daemon                        43.0-4
ii  gnome-shell-common                           43.6-1~deb12u2
ii  gsettings-desktop-schemas                    43.0-1
ii  gstreamer1.0-pipewire                        0.3.65-3
ii  libatk-bridge2.0-0                           2.46.0-5
ii  libatk1.0-0                                  2.46.0-5
ii  libc6                                        2.36-9+deb12u3
ii  libcairo2                                    1.16.0-7
ii  libecal-2.0-2                                3.46.4-2
ii  libedataserver-1.2-27                        3.46.4-2
ii  libgcr-base-3-1                              3.41.1-1+b1
ii  libgdk-pixbuf-2.0-0                          2.42.10+dfsg-1+b1
ii  libgirepository-1.0-1                        1.74.0-3
ii  libgjs0g                                     1.74.2-1+deb12u1
ii  libgles2                                     1.6.0-1
ii  libglib2.0-0                                 2.74.6-2
ii  libglib2.0-bin                               2.74.6-2
ii  libgnome-autoar-0-0                          0.4.3-1
ii  libgnome-desktop-3-20                        43.2-2
ii  libgraphene-1.0-0                            1.10.8-1
ii  libgtk-3-0                                   3.24.38-2~deb12u1
ii  libgtk-4-1                                   4.8.3+ds-2+deb12u1
ii  libical3                                     3.0.16-1+b1
ii  libjson-glib-1.0-0                           1.6.6-1
ii  libmutter-11-0                               43.6-1~deb12u1
ii  libnm0                                       1.42.4-1
ii  libpango-1.0-0                               1.50.12+ds-1
ii  libpangocairo-1.0-0                          1.50.12+ds-1
ii  libpolkit-agent-1-0                          122-3
ii  libpolkit-gobject-1-0                        122-3
ii  libpulse-mainloop-glib0                      16.1+dfsg1-2+b1
ii  libpulse0                                    16.1+dfsg1-2+b1
ii  libsecret-1-0                                0.20.5-3
ii  libsystemd0                                  252.17-1~deb12u1
ii  libwayland-server0                           1.21.0-1
ii  libx11-6                                     2:1.8.4-2+deb12u2
ii  libxfixes3                                   1:6.0.0-2
ii  python3                                      3.11.2-1+b1

Versions of packages gnome-shell recommends:
ii  bolt                   0.9.5-1
ii  chrome-gnome-shell     42.1-3
ii  evolution-data-server  3.46.4-2
ii  gdm3                   43.0-3
ii  gkbd-capplet           3.28.1-1
ii  gnome-control-center   1:43.6-2~deb12u1
ii  gnome-menus            3.36.0-1.1
ii  gnome-remote-desktop   43.3-1
ii  gnome-user-docs        43.0-2
ii  ibus                   1.5.27-5
ii  iio-sensor-proxy       3.0-2
ii  power-profiles-daemon  0.12-1+b1
ii  switcheroo-control     2.6-1+b1
ii  unzip                  6.0-28

Versions of packages gnome-shell suggests:
ii  gir1.2-malcontent-0          0.11.0-4
pn  gir1.2-telepathyglib-0.12    <none>
pn  gir1.2-telepathylogger-0.2   <none>
ii  gnome-shell-extension-prefs  43.6-1~deb12u2

Versions of packages gnome-session depends on:
ii  gnome-session-bin                                      43.0-1
ii  gnome-session-common                                   43.0-1
ii  gnome-settings-daemon                                  43.0-4
ii  xdg-desktop-portal-gnome [xdg-desktop-portal-backend]  43.1-2
ii  xdg-desktop-portal-gtk [xdg-desktop-portal-backend]    1.14.1-1

Versions of packages gnome-session suggests:
ii  desktop-base   12.0.6+nmu1~deb12u1
ii  gnome-keyring  42.1-1+b2

Versions of packages gnome-settings-daemon depends on:
ii  gnome-settings-daemon-common  43.0-4
ii  gsettings-desktop-schemas     43.0-1
ii  libasound2                    1.2.8-1+b1
ii  libc6                         2.36-9+deb12u3
ii  libcairo2                     1.16.0-7
ii  libcanberra-gtk3-0            0.30-10
ii  libcanberra0                  0.30-10
ii  libcolord2                    1.4.6-2.2
ii  libcups2                      2.4.2-3+deb12u4
ii  libfontconfig1                2.14.1-4
ii  libgcr-base-3-1               3.41.1-1+b1
ii  libgdk-pixbuf-2.0-0           2.42.10+dfsg-1+b1
ii  libgeoclue-2-0                2.6.0-2
ii  libgeocode-glib-2-0           3.26.3-6
ii  libglib2.0-0                  2.74.6-2
ii  libgnome-desktop-3-20         43.2-2
ii  libgtk-3-0                    3.24.38-2~deb12u1
ii  libgudev-1.0-0                237-2
ii  libgweather-4-0               4.2.0-2
ii  libmm-glib0                   1.20.4-1
ii  libnm0                        1.42.4-1
ii  libnotify4                    0.8.1-1
ii  libnspr4                      2:4.35-1
ii  libnss3                       2:3.87.1-1
ii  libpam-systemd [logind]       252.17-1~deb12u1
ii  libpango-1.0-0                1.50.12+ds-1
ii  libpangocairo-1.0-0           1.50.12+ds-1
ii  libpolkit-gobject-1-0         122-3
ii  libpulse-mainloop-glib0       16.1+dfsg1-2+b1
ii  libpulse0                     16.1+dfsg1-2+b1
ii  libspa-0.2-bluetooth          0.3.65-3
ii  libupower-glib3               0.99.20-2
ii  libwacom9                     2.6.0-1
ii  libwayland-client0            1.21.0-1
ii  libx11-6                      2:1.8.4-2+deb12u2
ii  libxext6                      2:1.3.4-1+b1
ii  libxfixes3                    1:6.0.0-2
ii  libxi6                        2:1.8-1+b1
ii  pipewire-audio                0.3.65-3

Versions of packages gnome-settings-daemon recommends:
ii  iio-sensor-proxy   3.0-2
ii  pipewire-audio     0.3.65-3
ii  pkexec             122-3
ii  x11-xserver-utils  7.7+9+b1

Versions of packages gnome-settings-daemon suggests:
pn  usbguard  <none>

Versions of packages libgjs0g depends on:
ii  libc6                                                    2.36-9+deb12u3
ii  libcairo-gobject2                                        1.16.0-7
ii  libcairo2                                                1.16.0-7
ii  libffi8                                                  3.4.4-1
ii  libgcc-s1                                                12.2.0-14
ii  libgirepository-1.0-1 [libgirepository-1.0-1-with-libff  1.74.0-3
    i8]
ii  libglib2.0-0                                             2.74.6-2
ii  libmozjs-102-0                                           102.15.1-1~deb12u1
ii  libreadline8                                             8.2-1.3
ii  libstdc++6                                               12.2.0-14
ii  libx11-6                                                 2:1.8.4-2+deb12u2

Versions of packages libmutter-11-0 depends on:
ii  adwaita-icon-theme         43-1
ii  gsettings-desktop-schemas  43.0-1
ii  libatk1.0-0                2.46.0-5
ii  libc6                      2.36-9+deb12u3
ii  libcairo-gobject2          1.16.0-7
ii  libcairo2                  1.16.0-7
ii  libcanberra0               0.30-10
ii  libcolord2                 1.4.6-2.2
ii  libdrm2                    2.4.114-1+b1
ii  libegl1                    1.6.0-1
ii  libfontconfig1             2.14.1-4
ii  libfribidi0                1.0.8-2.1
ii  libgbm1                    22.3.6-1+deb12u1
ii  libgdk-pixbuf-2.0-0        2.42.10+dfsg-1+b1
ii  libgl1                     1.6.0-1
ii  libglib2.0-0               2.74.6-2
ii  libgnome-desktop-3-20      43.2-2
ii  libgraphene-1.0-0          1.10.8-1
ii  libgtk-3-0                 3.24.38-2~deb12u1
ii  libgudev-1.0-0             237-2
ii  libice6                    2:1.0.10-1
ii  libinput10                 1.22.1-1
ii  libjson-glib-1.0-0         1.6.6-1
ii  liblcms2-2                 2.14-2
ii  libpango-1.0-0             1.50.12+ds-1
ii  libpangocairo-1.0-0        1.50.12+ds-1
ii  libpangoft2-1.0-0          1.50.12+ds-1
ii  libpipewire-0.3-0          0.3.65-3
ii  libsm6                     2:1.2.3-1
ii  libstartup-notification0   0.12-6+b1
ii  libsystemd0                252.17-1~deb12u1
ii  libudev1                   252.17-1~deb12u1
ii  libwacom9                  2.6.0-1
ii  libwayland-server0         1.21.0-1
ii  libx11-6                   2:1.8.4-2+deb12u2
ii  libx11-xcb1                2:1.8.4-2+deb12u2
ii  libxau6                    1:1.0.9-1
ii  libxcb-randr0              1.15-1
ii  libxcb-res0                1.15-1
ii  libxcb1                    1.15-1
ii  libxcomposite1             1:0.4.5-1
ii  libxcursor1                1:1.2.1-1
ii  libxdamage1                1:1.1.6-1
ii  libxext6                   2:1.3.4-1+b1
ii  libxfixes3                 1:6.0.0-2
ii  libxi6                     2:1.8-1+b1
ii  libxinerama1               2:1.1.4-3
ii  libxkbcommon-x11-0         1.5.0-1
ii  libxkbcommon0              1.5.0-1
ii  libxkbfile1                1:1.1.0-1
ii  libxrandr2                 2:1.5.2-2+b1
ii  libxtst6                   2:1.2.3-1.1
ii  mutter-common              43.6-1~deb12u1

Versions of packages gnome-shell is related to:
ii  libegl-mesa0 [libegl-vendor]  22.3.6-1+deb12u1
ii  libgl1-mesa-dri               22.3.6-1+deb12u1
ii  libglx-mesa0 [libglx-vendor]  22.3.6-1+deb12u1

-- no debconf information