From 2a390c18c1999ebc7e15cc718461809f5c6321c6 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 17 Sep 2021 02:38:00 +0900 Subject: [PATCH] internal/uidriver/glfw: Do not iconify the fullscreen window on Linux Updates #1506 --- internal/glfw/const.go | 1 + internal/uidriver/glfw/ui.go | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/internal/glfw/const.go b/internal/glfw/const.go index 2cb1e4344..a7c4610b1 100644 --- a/internal/glfw/const.go +++ b/internal/glfw/const.go @@ -79,6 +79,7 @@ const ( ) const ( + AutoIconify = Hint(0x00020006) ClientAPI = Hint(0x00022001) ContextVersionMajor = Hint(0x00022002) ContextVersionMinor = Hint(0x00022003) diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index ca9b8b1f1..b4d6f622f 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -849,6 +849,13 @@ func (u *UserInterface) init() error { glfw.WindowHint(glfw.ClientAPI, glfw.NoAPI) } + // Enable auto-iconifying on Windows and macOS until some fullscreen issues are solved (#1506). + if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { + glfw.WindowHint(glfw.AutoIconify, glfw.True) + } else { + glfw.WindowHint(glfw.AutoIconify, glfw.False) + } + decorated := glfw.False if u.isInitWindowDecorated() { decorated = glfw.True