From 85aabf734b1f129a935b7970945be763f3d7f1eb Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 10 Aug 2022 22:18:53 +0900 Subject: [PATCH] internal/ui: remove panic at (*glfwWindow).Maximize Just doing nothing is more consistent with other functions. Updates #1990 --- internal/ui/window_glfw.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/ui/window_glfw.go b/internal/ui/window_glfw.go index 00a7e006c..1d0bec5e6 100644 --- a/internal/ui/window_glfw.go +++ b/internal/ui/window_glfw.go @@ -113,10 +113,11 @@ func (w *glfwWindow) IsMaximized() bool { func (w *glfwWindow) Maximize() { // Do not allow maximizing the window when the window is not resizable. // On Windows, it is possible to restore the window from being maximized by mouse-dragging, - // and this can be an unexpected behavior. + // and this can be an unexpected behavior (#1990). if w.ResizingMode() != WindowResizingModeEnabled { - panic("ui: a window to maximize must be resizable") + return } + if !w.ui.isRunning() { w.ui.setInitWindowMaximized(true) return