Display fix for MacOS x86

This commit is contained in:
2025-08-31 18:41:21 -04:00
parent 602af77291
commit 6b7d0dfb0b

View File

@@ -1,5 +1,6 @@
using QemuVmManager.Models;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace QemuVmManager.Core;
@@ -230,7 +231,19 @@ public class QemuCommandBuilder
var display = _config.Display;
_arguments.Add("-display");
_arguments.Add(display.Type);
// Use appropriate display backend based on OS
string displayType = display.Type;
if (OperatingSystem.IsMacOS())
{
// On macOS, GTK is not available, use cocoa instead
if (displayType == "gtk")
{
displayType = "cocoa";
}
}
_arguments.Add(displayType);
_arguments.Add("-vga");
_arguments.Add(display.Vga);