From 7071efb6a3a4b3a63d6a1a46516d846ae088ee2c Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Tue, 12 May 2026 16:18:27 +0100 Subject: [PATCH] Fix switching modes on RISC OS --- src/video/SDL_video.c | 4 ++++ src/video/riscos/SDL_riscosmodes.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0a387fad2a..d20d5eefea 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1533,9 +1533,13 @@ bool SDL_SetDisplayModeForDisplay(SDL_VideoDisplay *display, SDL_DisplayMode *mo mode = &display->desktop_mode; } + // On RISC OS, it's necessary to switch from the desktop to single-tasking + // fullscreen so that it can handle switching back to the desktop correctly. +#ifndef SDL_PLATFORM_RISCOS if (mode == display->current_mode) { return true; } +#endif // Actually change the display mode if (_this->SetDisplayMode) { diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index 9dda0e5ac6..0da0cc8621 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -96,7 +96,7 @@ static size_t measure_mode_block(const int *block) return blockSize * 4; } -static bool read_mode_variable(int *block, int var) +static int read_mode_variable(int *block, int var) { _kernel_swi_regs regs; regs.r[0] = (int)block;