| 166 | } |
| 167 | |
| 168 | void WindowController::syncWindowedStateFromWindow() { |
| 169 | if (!window || isFullscreen) { |
| 170 | return; |
| 171 | } |
| 172 | |
| 173 | windowedWasMaximized = glfwGetWindowAttrib(window, GLFW_MAXIMIZED) == GLFW_TRUE; |
| 174 | GLFWmonitor* monitor = currentMonitor(); |
| 175 | windowedMonitorIndex = monitorIndex(monitor); |
| 176 | if (!windowedWasMaximized) { |
| 177 | glfwGetWindowPos(window, &windowedX, &windowedY); |
| 178 | glfwGetWindowSize(window, &windowedWidth, &windowedHeight); |
| 179 | return; |
| 180 | } |
| 181 | |
| 182 | if (monitor && monitorWorkArea(monitor, windowedX, windowedY, windowedWidth, windowedHeight)) { |
| 183 | return; |
| 184 | } |
| 185 | |
| 186 | glfwGetWindowPos(window, &windowedX, &windowedY); |
| 187 | glfwGetWindowSize(window, &windowedWidth, &windowedHeight); |
| 188 | } |
| 189 | |
| 190 | void WindowController::applyWindowedState() { |
| 191 | if (!window) { |
nothing calls this directly
no test coverage detected