From 10d6a3ad670c09f784500b536571fe006e1daa32 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 23 Aug 2020 02:31:52 +0900 Subject: [PATCH] uidriver/glfw: Bug fix: Crash on Wine when getting a monitor --- internal/uidriver/glfw/ui_windows.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/uidriver/glfw/ui_windows.go b/internal/uidriver/glfw/ui_windows.go index b8de22861..17c7a5bb7 100644 --- a/internal/uidriver/glfw/ui_windows.go +++ b/internal/uidriver/glfw/ui_windows.go @@ -145,7 +145,8 @@ func (u *UserInterface) currentMonitorFromPosition() *glfw.Monitor { m, err := monitorFromWindow(w, monitorDefaultToNearest) if err != nil { - panic(err) + // monitorFromWindow can return error on Wine. Ignore this. + return glfw.GetPrimaryMonitor() } mi := monitorInfo{}