mirror of
https://github.com/SK-la/osu-framework.git
synced 2026-03-15 03:20:30 +00:00
Remove borderless fullscreen on non-Windows platforms
e3395a7585/docs/README-migration.md (L1693)
This commit is contained in:
@@ -39,7 +39,7 @@ namespace osu.Framework.iOS
|
||||
protected override unsafe void UpdateWindowStateAndSize(WindowState state, Display display, DisplayMode displayMode)
|
||||
{
|
||||
// This sets the status bar to hidden.
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN);
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, SDL_bool.SDL_TRUE);
|
||||
|
||||
// Don't run base logic at all. Let's keep things simple.
|
||||
}
|
||||
|
||||
@@ -864,8 +864,7 @@ namespace osu.Framework.Platform.SDL2
|
||||
|
||||
public static WindowState ToWindowState(this SDL_WindowFlags windowFlags)
|
||||
{
|
||||
if (windowFlags.HasFlagFast(SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP) ||
|
||||
windowFlags.HasFlagFast(SDL_WindowFlags.SDL_WINDOW_BORDERLESS))
|
||||
if (windowFlags.HasFlagFast(SDL_WindowFlags.SDL_WINDOW_BORDERLESS))
|
||||
return WindowState.FullscreenBorderless;
|
||||
|
||||
if (windowFlags.HasFlagFast(SDL_WindowFlags.SDL_WINDOW_MINIMIZED))
|
||||
@@ -897,7 +896,7 @@ namespace osu.Framework.Platform.SDL2
|
||||
return SDL_WindowFlags.SDL_WINDOW_MINIMIZED;
|
||||
|
||||
case WindowState.FullscreenBorderless:
|
||||
return SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
return SDL_WindowFlags.SDL_WINDOW_BORDERLESS;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace osu.Framework.Platform
|
||||
// if it is not included, the GL context will not get the correct size.
|
||||
// this is mentioned by multiple sources as an SDL issue, which seems to resolve by similar means (see https://discourse.libsdl.org/t/sdl-setwindowsize-does-not-work-in-fullscreen/20711/4).
|
||||
SDL3.SDL_SetWindowBordered(SDLWindowHandle, SDL_bool.SDL_TRUE);
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, (uint)SDL_bool.SDL_FALSE);
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, SDL_bool.SDL_FALSE);
|
||||
SDL3.SDL_RestoreWindow(SDLWindowHandle);
|
||||
|
||||
base.UpdateWindowStateAndSize(state, display, displayMode);
|
||||
|
||||
@@ -146,7 +146,10 @@ namespace osu.Framework.Platform
|
||||
if (RuntimeInfo.IsMobile)
|
||||
return new[] { Configuration.WindowMode.Fullscreen };
|
||||
|
||||
return Enum.GetValues<WindowMode>();
|
||||
if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows)
|
||||
return Enum.GetValues<WindowMode>();
|
||||
|
||||
return new[] { Configuration.WindowMode.Windowed, Configuration.WindowMode.Fullscreen };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -623,7 +626,7 @@ namespace osu.Framework.Platform
|
||||
ensureWindowOnDisplay(display);
|
||||
|
||||
SDL3.SDL_SetWindowFullscreenMode(SDLWindowHandle, &closestMode);
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN);
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, SDL_bool.SDL_TRUE);
|
||||
break;
|
||||
|
||||
case WindowState.FullscreenBorderless:
|
||||
@@ -777,15 +780,7 @@ namespace osu.Framework.Platform
|
||||
/// <returns>
|
||||
/// The size of the borderless window's draw area.
|
||||
/// </returns>
|
||||
protected virtual unsafe Size SetBorderless(Display display)
|
||||
{
|
||||
ensureWindowOnDisplay(display);
|
||||
|
||||
// this is a generally sane method of handling borderless, and works well on macOS and linux.
|
||||
SDL3.SDL_SetWindowFullscreen(SDLWindowHandle, (uint)SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
|
||||
return display.Bounds.Size;
|
||||
}
|
||||
protected virtual Size SetBorderless(Display display) => throw new PlatformNotSupportedException();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user