Skip to content

Commit 23e8ad0

Browse files
committed
Fix window not storing maximize state across runs
1 parent c67c100 commit 23e8ad0

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

engine/system/win/sys_video.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,12 @@ int sys_video_c::Apply(sys_vidSet_s* set)
269269
bool maximized = glfwGetWindowAttrib(wnd, GLFW_MAXIMIZED);
270270
sys->video->SizeChanged(width, height, maximized);
271271
});
272+
glfwSetWindowMaximizeCallback(wnd, [](GLFWwindow* wnd, int maximized) {
273+
auto sys = (sys_main_c*)glfwGetWindowUserPointer(wnd);
274+
int width{}, height{};
275+
glfwGetWindowSize(wnd, &width, &height);
276+
sys->video->SizeChanged(width, height, maximized == GLFW_TRUE);
277+
});
272278
glfwSetWindowPosCallback(wnd, [](GLFWwindow* wnd, int x, int y) {
273279
auto sys = (sys_main_c*)glfwGetWindowUserPointer(wnd);
274280
sys->video->PosChanged(x, y);

0 commit comments

Comments
 (0)