Control: reassign -1 src:cataclysm-dda 0.F-3-8
Control: tags -1 + patch

On Fri, 09 Dec 2022 at 17:58:38 +0000, Simon McVittie wrote:
> With SDL 2.26, it seems that under some circumstances (lxc but not qemu
> or podman, for some reason), the window won't become fullscreen without
> a window manager being present.

Bisecting SDL reveals that this was triggered by an intentional change,
<https://github.com/libsdl-org/SDL/commit/4ca7b378c5b831a82f1f0fa132939e8a3b6ac59a>.

Before that commit, SDL would set the window dimensions to the screen
size and also set the "please fullscreen" flag. However, this meant that
un-fullscreening a window would result in it still being screen-sized.

Since that commit, SDL sets the window dimensions to its non-fullscreen
size but sets the "please fullscreen" flag. A compatible window manager
will ignore the window dimensions and display the game full-screen, but
when the window leaves fullscreen, the window manager will use the
windowed dimensions automatically.

Assuming that full-screen will work as intended without a window manager
seems like a bug in cataclysm-dda's autopkgtest rather than a sign of
missing functionality in SDL, so I'm reassigning this to cataclysm-dda.
Please consider the attached patch, also available from
<https://salsa.debian.org/smcv/cataclysm-dda-branches/-/tree/autopkgtest-wm>
(git fetch https://salsa.debian.org/smcv/cataclysm-dda-branches autopkgtest-wm).

You might also find the changes in
<https://salsa.debian.org/smcv/cataclysm-dda-branches/-/tree/autopkgtest-misc>
useful for debugging and/or test robustness
(git fetch https://salsa.debian.org/smcv/cataclysm-dda-branches 
autopkgtest-misc).

    smcv
>From c64b43ab617b4125917c8badc84530cad62aa50a Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Fri, 9 Dec 2022 14:03:03 +0000
Subject: [PATCH] d/tests/test-tiles: Run a window manager inside Xvfb

Previously, this test relied on SDL setting the window dimensions to the
full size of the screen, so that even when running in an Xvfb
environment without a window manager, it will occupy the whole screen
area and have the contents we are looking for.

However, since commit <https://github.com/libsdl-org/SDL/commit/4ca7b378>,
SDL instead sets the window dimensions to its non-windowed size, relying
on the window manager to obey the "please make this fullscreen" flag and
ignore those dimensions. This was done to fix a bug: without that
information, when the window becomes non-fullscreen, the window manager
cannot know how large it should become.

Games are generally designed to run under a window manager, so running
without a window manager is not a realistic test. Adding a simple window
manager (openbox) makes this test more realistic, and also ensures that
the "draw as fullscreen" flag is respected.

Signed-off-by: Simon McVittie <s...@debian.org>
Closes: #1025775
---
 debian/tests/control    | 2 +-
 debian/tests/test-tiles | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/debian/tests/control b/debian/tests/control
index f066122e..67ee6cf1 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -4,4 +4,4 @@ Depends: cataclysm-dda-curses, expect, locales-all
 
 Test-Command: timeout -v 5m xvfb-run debian/tests/test-tiles
 Restrictions: allow-stderr, superficial
-Depends: cataclysm-dda-sdl, xvfb, xauth, xdotool, scrot, tesseract-ocr, locales-all, pulseaudio
+Depends: cataclysm-dda-sdl, openbox, xvfb, xauth, xdotool, scrot, tesseract-ocr, locales-all, pulseaudio
diff --git a/debian/tests/test-tiles b/debian/tests/test-tiles
index 566dcb60..db4ed9c8 100755
--- a/debian/tests/test-tiles
+++ b/debian/tests/test-tiles
@@ -13,7 +13,8 @@ export LANG=en_US.UTF-8
 # cdda needs audio or it won't start (#59464)
 pulseaudio --start
 
-# start cdda and wait a bit
+# start cdda and a window manager, and wait a bit
+openbox &
 cataclysm-tiles &
 PID=$!
 sleep 15
-- 
2.38.1

Reply via email to