|
48 | 48 |
|
49 | 49 | #include <coreinit/foreground.h> |
50 | 50 | #include <proc_ui/procui.h> |
| 51 | +#include <sysapp/launch.h> |
51 | 52 |
|
52 | 53 | #include <gx2/context.h> |
53 | 54 | #include <gx2/display.h> |
@@ -290,6 +291,27 @@ static void WIIU_VideoQuit(_THIS) |
290 | 291 | { |
291 | 292 | WIIU_VideoData *videodata = (WIIU_VideoData *) _this->driverdata; |
292 | 293 |
|
| 294 | + if (videodata->handleProcUI) { |
| 295 | + // Put ProcUI into EXIT/shutdown state if user stopped processing events |
| 296 | + // before SDL_QUIT was generated. |
| 297 | + if (ProcUIIsRunning() && !ProcUIInShutdown()) { |
| 298 | + SDL_bool procui_running = SDL_TRUE; |
| 299 | + SYSLaunchMenu(); |
| 300 | + while (procui_running) { |
| 301 | + switch (ProcUIProcessMessages(TRUE)) { |
| 302 | + case PROCUI_STATUS_RELEASE_FOREGROUND: |
| 303 | + ProcUIDrawDoneRelease(); |
| 304 | + break; |
| 305 | + case PROCUI_STATUS_EXITING: |
| 306 | + procui_running = SDL_FALSE; |
| 307 | + break; |
| 308 | + default: |
| 309 | + ; |
| 310 | + } |
| 311 | + } |
| 312 | + } |
| 313 | + } |
| 314 | + |
293 | 315 | // if we're in foreground, destroy foreground data |
294 | 316 | if (videodata->hasForeground) { |
295 | 317 | WIIU_ForegroundReleased(_this); |
@@ -344,7 +366,7 @@ static void WIIU_PumpEvents(_THIS) |
344 | 366 | { |
345 | 367 | WIIU_VideoData *videodata = (WIIU_VideoData *) _this->driverdata; |
346 | 368 |
|
347 | | - if (videodata->handleProcUI) { |
| 369 | + if (videodata->handleProcUI && !ProcUIInShutdown()) { |
348 | 370 | if (videodata->enteringBackground) { |
349 | 371 | // The previous ProcUIProcessMessages() received a |
350 | 372 | // PROCUI_STATUS_RELEASE_FOREGROUND. |
|
0 commit comments