From 8ed55ef42d6d3bf8f79d3b46d497bccf4ab39c65 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 19 Sep 2021 00:13:53 +0900 Subject: [PATCH] internal/uidriver/glfw: Use the window size on a native fullscreen Updates #1745 --- internal/uidriver/glfw/ui.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index 97150a2ed..fd852456c 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -936,7 +936,11 @@ func (u *UserInterface) updateSize() (float64, float64, bool) { u.toChangeSize = false var w, h float64 - if u.isFullscreen() { + if u.isFullscreen() && !u.isNativeFullscreen() { + // On Linux, the window size is not reliable just after making the window + // fullscreened. Use the monitor size. + // On macOS's native fullscreen, the window's size returns a more precise size + // reflecting the adjustment of the view size (#1745). m := currentMonitor(u.window) v := m.GetVideoMode() ww, wh := v.Width, v.Height