mirror of
https://github.com/love2d/megasource.git
synced 2026-08-20 04:30:45 +02:00
update SDL3 to 3.2.10.
This commit is contained in:
@@ -1435,6 +1435,11 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
|
||||
{
|
||||
SDL_DisplayMode last_mode;
|
||||
|
||||
if (display->fullscreen_active) {
|
||||
// This is a temporary mode change, don't save the desktop mode
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_copyp(&last_mode, &display->desktop_mode);
|
||||
|
||||
if (display->desktop_mode.internal) {
|
||||
@@ -1944,6 +1949,8 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
||||
SDL_MinimizeWindow(display->fullscreen_window);
|
||||
}
|
||||
|
||||
display->fullscreen_active = window->fullscreen_exclusive;
|
||||
|
||||
if (!SDL_SetDisplayModeForDisplay(display, mode)) {
|
||||
goto error;
|
||||
}
|
||||
@@ -1961,6 +1968,7 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_ENTER_FULLSCREEN, 0, 0);
|
||||
}
|
||||
} else if (ret == SDL_FULLSCREEN_FAILED) {
|
||||
display->fullscreen_active = false;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
@@ -1976,18 +1984,24 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
||||
* This is also unnecessary on Cocoa, Wayland, Win32, and X11 (will send SDL_EVENT_WINDOW_RESIZED).
|
||||
*/
|
||||
if (!SDL_SendsFullscreenDimensions(_this)) {
|
||||
SDL_Rect displayRect;
|
||||
|
||||
if (mode) {
|
||||
mode_w = mode->w;
|
||||
mode_h = mode->h;
|
||||
SDL_GetDisplayBounds(mode->displayID, &displayRect);
|
||||
} else {
|
||||
mode_w = display->desktop_mode.w;
|
||||
mode_h = display->desktop_mode.h;
|
||||
SDL_GetDisplayBounds(display->id, &displayRect);
|
||||
}
|
||||
|
||||
if (window->w != mode_w || window->h != mode_h) {
|
||||
resized = true;
|
||||
}
|
||||
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, displayRect.x, displayRect.y);
|
||||
|
||||
if (resized) {
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, mode_w, mode_h);
|
||||
} else {
|
||||
@@ -2005,6 +2019,8 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
||||
|
||||
// Restore the desktop mode
|
||||
if (display) {
|
||||
display->fullscreen_active = false;
|
||||
|
||||
SDL_SetDisplayModeForDisplay(display, NULL);
|
||||
}
|
||||
if (commit) {
|
||||
@@ -2034,6 +2050,7 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
|
||||
}
|
||||
|
||||
if (!SDL_SendsFullscreenDimensions(_this)) {
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, window->windowed.x, window->windowed.y);
|
||||
if (resized) {
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window->windowed.w, window->windowed.h);
|
||||
} else {
|
||||
@@ -2907,11 +2924,12 @@ bool SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const bool use_pending = (window->flags & SDL_WINDOW_HIDDEN) && window->last_position_pending;
|
||||
if (x) {
|
||||
*x = window->x;
|
||||
*x = use_pending ? window->pending.x : window->x;
|
||||
}
|
||||
if (y) {
|
||||
*y = window->y;
|
||||
*y = use_pending ? window->pending.y : window->y;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -5387,6 +5405,10 @@ bool SDL_GetTextInputMultiline(SDL_PropertiesID props)
|
||||
static bool AutoShowingScreenKeyboard(void)
|
||||
{
|
||||
const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD);
|
||||
if (!hint) {
|
||||
// Steam will eventually have smarts about whether a keyboard is active, so always request the on-screen keyboard on Steam Deck
|
||||
hint = SDL_GetHint("SteamDeck");
|
||||
}
|
||||
if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) ||
|
||||
SDL_GetStringBoolean(hint, false)) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user