MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / snapshot

Method snapshot

App/WindowController.cpp:274–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274UserSettings::WindowState WindowController::snapshot() {
275 UserSettings::WindowState state{};
276 state.fullscreen = isFullscreen;
277 state.maximized = windowedWasMaximized;
278 state.monitorIndex = isFullscreen ? windowedMonitorIndex : monitorIndex(currentMonitor());
279 state.x = windowedX;
280 state.y = windowedY;
281 state.width = windowedWidth;
282 state.height = windowedHeight;
283
284 if (!state.fullscreen && window) {
285 syncWindowedStateFromWindow();
286 state.maximized = glfwGetWindowAttrib(window, GLFW_MAXIMIZED) == GLFW_TRUE;
287 state.monitorIndex = monitorIndex(currentMonitor());
288 if (state.maximized) {
289 GLFWmonitor* monitor = monitorByIndex(state.monitorIndex);
290 if (!monitorWorkArea(monitor, state.x, state.y, state.width, state.height)) {
291 glfwGetWindowPos(window, &state.x, &state.y);
292 glfwGetWindowSize(window, &state.width, &state.height);
293 }
294 }
295 else {
296 glfwGetWindowPos(window, &state.x, &state.y);
297 glfwGetWindowSize(window, &state.width, &state.height);
298 }
299 }
300
301 return state;
302}

Callers

nothing calls this directly

Calls 1

monitorWorkAreaFunction · 0.85

Tested by

no test coverage detected