| 5 | |
| 6 | namespace { |
| 7 | void logWindowState(const char* label, GLFWwindow* window, bool isFullscreen, bool windowedWasMaximized) { |
| 8 | if (!window) { |
| 9 | std::cerr << "[WindowController] " << label << " window=null" << std::endl; |
| 10 | return; |
| 11 | } |
| 12 | |
| 13 | int x = 0; |
| 14 | int y = 0; |
| 15 | int width = 0; |
| 16 | int height = 0; |
| 17 | glfwGetWindowPos(window, &x, &y); |
| 18 | glfwGetWindowSize(window, &width, &height); |
| 19 | |
| 20 | std::cerr |
| 21 | << "[WindowController] " << label |
| 22 | << " ptr=" << window |
| 23 | << " fullscreen=" << isFullscreen |
| 24 | << " monitor=" << glfwGetWindowMonitor(window) |
| 25 | << " decorated=" << glfwGetWindowAttrib(window, GLFW_DECORATED) |
| 26 | << " maximized=" << glfwGetWindowAttrib(window, GLFW_MAXIMIZED) |
| 27 | << " focused=" << glfwGetWindowAttrib(window, GLFW_FOCUSED) |
| 28 | << " iconified=" << glfwGetWindowAttrib(window, GLFW_ICONIFIED) |
| 29 | << " savedMaximized=" << windowedWasMaximized |
| 30 | << " pos=(" << x << "," << y << ")" |
| 31 | << " size=(" << width << "x" << height << ")" |
| 32 | << std::endl; |
| 33 | } |
| 34 | |
| 35 | bool monitorWorkArea(GLFWmonitor* monitor, int& x, int& y, int& width, int& height) { |
| 36 | if (!monitor) { |