From 5e14c0256190d008efb9f078db02a7cd9bf311e5 Mon Sep 17 00:00:00 2001 From: ohowe Date: Mon, 2 Oct 2023 21:40:06 -0600 Subject: [PATCH] [wpigui] Fix loading a maximized window on second monitor --- wpigui/src/main/native/cpp/wpigui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpigui/src/main/native/cpp/wpigui.cpp b/wpigui/src/main/native/cpp/wpigui.cpp index 6fd39ae7e3f..e2e05ce0674 100644 --- a/wpigui/src/main/native/cpp/wpigui.cpp +++ b/wpigui/src/main/native/cpp/wpigui.cpp @@ -227,8 +227,6 @@ bool gui::Initialize(const char* title, int width, int height, } // Set initial window settings - glfwWindowHint(GLFW_MAXIMIZED, gContext->maximized ? GLFW_TRUE : GLFW_FALSE); - if (gContext->width == 0 || gContext->height == 0) { gContext->width = gContext->defaultWidth; gContext->height = gContext->defaultHeight; @@ -303,6 +301,10 @@ bool gui::Initialize(const char* title, int width, int height, glfwShowWindow(gContext->window); } + if (gContext->maximized) { + glfwMaximizeWindow(gContext->window); + } + // Set window callbacks glfwGetWindowSize(gContext->window, &gContext->width, &gContext->height); glfwSetWindowSizeCallback(gContext->window, WindowSizeCallback);