Skip to content

Commit

Permalink
Meta: Only try to use SDL when there are multiple displays
Browse files Browse the repository at this point in the history
SDL brings with it an annoying issue whereby trying to resize the window
before Serenity starts up prevents it from automatically resizing to fit
the screen.

This patch makes the previous behavior (i.e using the GTK backend) the
default unless SERENITY_SCREENS is greater than 1.
  • Loading branch information
X-yl authored and awesomekling committed Jul 11, 2021
1 parent a8c35b6 commit 642aa65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Meta/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ if [ "$installed_major_version" -lt "$SERENITY_QEMU_MIN_REQ_VERSION" ]; then
fi

SERENITY_SCREENS="${SERENITY_SCREENS:-1}"
if (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then
if [ $SERENITY_SCREENS = 1 ]; then
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-gtk,gl=on}"
elif (uname -a | grep -iq WSL) || (uname -a | grep -iq microsoft); then
# QEMU for windows does not like gl=on, so detect if we are building in wsl, and if so, disable it
SERENITY_QEMU_DISPLAY_BACKEND="${SERENITY_QEMU_DISPLAY_BACKEND:-sdl,gl=off}"
elif ("${SERENITY_QEMU_BIN}" --display help | grep -iq sdl) && (ldconfig -p | grep -iq virglrenderer); then
Expand Down

0 comments on commit 642aa65

Please sign in to comment.