| 146 | } |
| 147 | |
| 148 | void EmuThread::startFullscreenUI(bool fullscreen) |
| 149 | { |
| 150 | if (!isOnEmuThread()) |
| 151 | { |
| 152 | QMetaObject::invokeMethod(this, "startFullscreenUI", Qt::QueuedConnection, Q_ARG(bool, fullscreen)); |
| 153 | return; |
| 154 | } |
| 155 | |
| 156 | if (VMManager::HasValidVM() || MTGS::IsOpen()) |
| 157 | return; |
| 158 | |
| 159 | // this should just set the flag so it gets automatically started |
| 160 | ImGuiManager::InitializeFullscreenUI(); |
| 161 | m_run_fullscreen_ui.store(true, std::memory_order_release); |
| 162 | m_is_rendering_to_main = shouldRenderToMain(); |
| 163 | m_is_fullscreen = fullscreen; |
| 164 | |
| 165 | if (!MTGS::WaitForOpen()) |
| 166 | { |
| 167 | m_run_fullscreen_ui.store(false, std::memory_order_release); |
| 168 | return; |
| 169 | } |
| 170 | |
| 171 | emit onFullscreenUIStateChange(true); |
| 172 | |
| 173 | // poll more frequently so we don't lose events |
| 174 | stopBackgroundControllerPollTimer(); |
| 175 | startBackgroundControllerPollTimer(); |
| 176 | } |
| 177 | |
| 178 | void EmuThread::stopFullscreenUI() |
| 179 | { |
no outgoing calls
no test coverage detected