| 243 | } |
| 244 | |
| 245 | void WindowController::toggleFullscreen() { |
| 246 | if (!window) { |
| 247 | return; |
| 248 | } |
| 249 | |
| 250 | logWindowState("before-toggle", window, isFullscreen, windowedWasMaximized); |
| 251 | |
| 252 | if (isFullscreen) { |
| 253 | applyWindowedState(); |
| 254 | isFullscreen = false; |
| 255 | syncWindowedStateFromWindow(); |
| 256 | logWindowState("after-toggle", window, isFullscreen, windowedWasMaximized); |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | syncWindowedStateFromWindow(); |
| 261 | GLFWmonitor* monitor = currentMonitor(); |
| 262 | if (!monitor) { |
| 263 | monitor = monitorByIndex(windowedMonitorIndex); |
| 264 | } |
| 265 | if (!monitor) { |
| 266 | return; |
| 267 | } |
| 268 | windowedMonitorIndex = monitorIndex(monitor); |
| 269 | applyFullscreen(monitor); |
| 270 | isFullscreen = true; |
| 271 | logWindowState("after-toggle", window, isFullscreen, windowedWasMaximized); |
| 272 | } |
| 273 | |
| 274 | UserSettings::WindowState WindowController::snapshot() { |
| 275 | UserSettings::WindowState state{}; |
nothing calls this directly
no test coverage detected