From 8b0c930c2dbc538c64be2871ab924a28ac179eea Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 28 Sep 2024 02:51:37 +0900 Subject: [PATCH] internal/ui: bug fix: an undecorated window should reach the top of the screen Closes #3118 --- internal/ui/ui_windows.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/ui/ui_windows.go b/internal/ui/ui_windows.go index 6eda1b921..93249abbf 100644 --- a/internal/ui/ui_windows.go +++ b/internal/ui/ui_windows.go @@ -115,6 +115,15 @@ func (u *UserInterface) adjustWindowPosition(x, y int, monitor *Monitor) (int, i return x, y, nil } + // If a window is not decorated, the window should be able to reach the top of the screen (#3118). + d, err := u.window.GetAttrib(glfw.Decorated) + if err != nil { + return 0, 0, err + } + if d == glfw.False { + return x, y, nil + } + mx := monitor.boundsInGLFWPixels.Min.X my := monitor.boundsInGLFWPixels.Min.Y // As the video width/height might be wrong,