From 177a6f38e0745d08768c6d363ef081be5dccbcd1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 1 Feb 2023 11:45:31 -0800 Subject: [PATCH] Only minimize the window for an assert if it's in exclusive fullscreen mode --- src/SDL_assert.c | 2 +- test/testwm.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SDL_assert.c b/src/SDL_assert.c index 705a1fa25..d243f66bd 100644 --- a/src/SDL_assert.c +++ b/src/SDL_assert.c @@ -213,7 +213,7 @@ static SDL_AssertState SDLCALL SDL_PromptAssertion(const SDL_AssertData *data, v /* Leave fullscreen mode, if possible (scary!) */ window = SDL_GetFocusWindow(); if (window) { - if ((SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN) != 0) { + if (window->fullscreen_exclusive) { SDL_MinimizeWindow(window); } else { /* !!! FIXME: ungrab the input if we're not fullscreen? */ diff --git a/test/testwm.c b/test/testwm.c index 1cd4ff35d..39ea5813a 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -182,7 +182,9 @@ void loop() if (event.type == SDL_EVENT_KEY_UP) { SDL_bool updateCursor = SDL_FALSE; - if (event.key.keysym.sym == SDLK_LEFT) { + if (event.key.keysym.sym == SDLK_a) { + SDL_assert(!"Keyboard generated assert"); + } else if (event.key.keysym.sym == SDLK_LEFT) { --system_cursor; if (system_cursor < 0) { system_cursor = SDL_NUM_SYSTEM_CURSORS - 1;