This commit is contained in:
eafton 2026-05-31 20:47:12 +02:00 committed by GitHub
commit 3cab78bf86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 3 deletions

View file

@ -4301,6 +4301,20 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
/**
* A variable controlling whether the X11 built in toolkit is prefered over Zenity.
*
* The variable can be set to the following values:
*
* - "0": Use Zenity if available. (default)
* - "1": Always use the toolkit over Zenity.
*
* This hint should be set before a messagebox is created.
*
* \since This hint is available since SDL 3.4.0.
*/
#define SDL_HINT_VIDEO_X11_PREFER_TOOLKIT "SDL_VIDEO_X11_PREFER_TOOLKIT"
/**
* A variable controlling whether touch should be enabled on the back panel of
* the PlayStation Vita.

View file

@ -280,8 +280,10 @@ static bool X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int
// Display an x11 message box.
bool X11_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID)
{
if (SDL_Zenity_ShowMessageBox(messageboxdata, buttonID)) {
return true;
if (!SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_PREFER_TOOLKIT, false)) {
if (SDL_Zenity_ShowMessageBox(messageboxdata, buttonID)) {
return true;
}
}
#if SDL_FORK_MESSAGEBOX