| 1314 | } |
| 1315 | |
| 1316 | void MainWindow::updateWindowState(bool force_visible) |
| 1317 | { |
| 1318 | // Skip all of this when we're closing, since we don't want to make ourselves visible and cancel it. |
| 1319 | if (m_is_closing) |
| 1320 | return; |
| 1321 | |
| 1322 | const bool hide_window = !isRenderingToMain() && shouldHideMainWindow(); |
| 1323 | const bool disable_resize = Host::GetBoolSettingValue("UI", "DisableWindowResize", false); |
| 1324 | const bool has_window = s_vm_valid || m_display_surface; |
| 1325 | |
| 1326 | // Need to test both valid and display widget because of startup (vm invalid while window is created). |
| 1327 | const bool visible = force_visible || !hide_window || !has_window; |
| 1328 | if (isVisible() != visible) |
| 1329 | setVisible(visible); |
| 1330 | |
| 1331 | // No point changing realizability if we're not visible. |
| 1332 | const bool resizeable = force_visible || !disable_resize || !has_window; |
| 1333 | if (visible) |
| 1334 | QtUtils::SetWindowResizeable(this, resizeable); |
| 1335 | |
| 1336 | // Update the display widget too if rendering separately. |
| 1337 | if (m_display_surface && !isRenderingToMain()) |
| 1338 | { |
| 1339 | #ifdef DISPLAY_SURFACE_WINDOW |
| 1340 | QtUtils::SetWindowResizeable(m_display_surface, resizeable); |
| 1341 | #else |
| 1342 | QtUtils::SetWindowResizeable(m_display_container, resizeable); |
| 1343 | #endif |
| 1344 | } |
| 1345 | } |
| 1346 | |
| 1347 | void MainWindow::setProgressBar(int current, int total) |
| 1348 | { |
nothing calls this directly
no test coverage detected