| 188 | } |
| 189 | |
| 190 | void WindowController::applyWindowedState() { |
| 191 | if (!window) { |
| 192 | return; |
| 193 | } |
| 194 | |
| 195 | int targetX = windowedX; |
| 196 | int targetY = windowedY; |
| 197 | int targetWidth = windowedWidth; |
| 198 | int targetHeight = windowedHeight; |
| 199 | if (windowedWasMaximized) { |
| 200 | if (GLFWmonitor* monitor = monitorByIndex(windowedMonitorIndex)) { |
| 201 | monitorWorkArea(monitor, targetX, targetY, targetWidth, targetHeight); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | glfwSetWindowMonitor(window, nullptr, targetX, targetY, targetWidth, targetHeight, GLFW_DONT_CARE); |
| 206 | if (windowedWasMaximized) { |
| 207 | glfwMaximizeWindow(window); |
| 208 | } |
| 209 | glfwFocusWindow(window); |
| 210 | } |
| 211 | |
| 212 | void WindowController::applyFullscreen(GLFWmonitor* monitor) { |
| 213 | if (!window || !monitor) { |
nothing calls this directly
no test coverage detected