Skip to content

Commit

Permalink
[wpigui] Fix loading a maximized window on second monitor (wpilibsuit…
Browse files Browse the repository at this point in the history
  • Loading branch information
ohowe1 authored and calcmogul committed Oct 9, 2023
1 parent eabf2f1 commit 95afbaa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wpigui/src/main/native/cpp/wpigui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 95afbaa

Please sign in to comment.