Browse Source

If window is minimized, don't set nonsense window position and size to settings, making the window disappear on next launch.

tags/v2.0.4
Andrew Belt 2 years ago
parent
commit
cbc4255b4e
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/window/Window.cpp

+ 4
- 0
src/window/Window.cpp View File

@@ -106,6 +106,8 @@ struct Window::Internal {
static void windowPosCallback(GLFWwindow* win, int x, int y) {
if (glfwGetWindowAttrib(win, GLFW_MAXIMIZED))
return;
if (glfwGetWindowAttrib(win, GLFW_ICONIFIED))
return;
if (glfwGetWindowMonitor(win))
return;
settings::windowPos = math::Vec(x, y);
@@ -116,6 +118,8 @@ static void windowPosCallback(GLFWwindow* win, int x, int y) {
static void windowSizeCallback(GLFWwindow* win, int width, int height) {
if (glfwGetWindowAttrib(win, GLFW_MAXIMIZED))
return;
if (glfwGetWindowAttrib(win, GLFW_ICONIFIED))
return;
if (glfwGetWindowMonitor(win))
return;
settings::windowSize = math::Vec(width, height);


Loading…
Cancel
Save