Refactor video configuration

macOS now ignores any resolution coercion. Display resolution on macOS is now configured via macOS System Preferences only.
This commit is contained in:
Martin Wimpress 2021-09-28 15:43:18 +01:00
parent eae506e24a
commit 9378d6b637
No known key found for this signature in database
GPG key ID: 61DF940515E06DA3

View file

@ -375,13 +375,20 @@ function vm_boot() {
echo " - Video: ${DISPLAY_DEVICE}" echo " - Video: ${DISPLAY_DEVICE}"
# Allocate VRAM to VGA devices # Build the video configuration
if [ "${DISPLAY_DEVICE}" == "qxl-vga" ] || [ "${DISPLAY_DEVICE}" == "VGA" ]; then VIDEO="-device ${DISPLAY_DEVICE}"
VIDEO="-device ${DISPLAY_DEVICE},xres=${X_RES},yres=${Y_RES},vgamem_mb=128 ${FULLSCREEN}"
else # Do not try and coerce the display resolution for macOS
VIDEO="-device ${DISPLAY_DEVICE},xres=${X_RES},yres=${Y_RES} ${FULLSCREEN}" if [ "${guest_os}" != "macos" ]; then
VIDEO="${VIDEO},xres=${X_RES},yres=${Y_RES}"
fi fi
# Allocate VRAM to VGA devices
if [[ "${DISPLAY_DEVICE}" == *"vga"* ]] || [[ "${DISPLAY_DEVICE}" == *"VGA"* ]]; then
VIDEO="${VIDEO},vgamem_mb=128"
fi
VIDEO="${VIDEO} ${FULLSCREEN}"
if [ "${OUTPUT}" == "gtk" ]; then if [ "${OUTPUT}" == "gtk" ]; then
OUTPUT="${OUTPUT},grab-on-hover=on,zoom-to-fit=off" OUTPUT="${OUTPUT},grab-on-hover=on,zoom-to-fit=off"
# GL is not working with GTK and virtio-vga # GL is not working with GTK and virtio-vga
@ -395,7 +402,7 @@ function vm_boot() {
fi fi
echo " - GL: ${GL^^}" echo " - GL: ${GL^^}"
if [ "${GL}" == "on" ] && [ "${DISPLAY_DEVICE}" == "virtio-vga" ]; then if [ "${GL}" == "on" ] && [[ "${DISPLAY_DEVICE}" == *"virtio"* ]]; then
DISPLAY_DEVICE="${DISPLAY_DEVICE},virgl=on" DISPLAY_DEVICE="${DISPLAY_DEVICE},virgl=on"
echo " - Virgil3D: ON" echo " - Virgil3D: ON"
else else