|
@@ -288,6 +288,8 @@ static void X11_OnMessageBoxScaleChange(SDL_ToolkitWindowX11 *window, void *data
|
|
|
|
|
|
|
|
static bool X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonID)
|
|
static bool X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int *buttonID)
|
|
|
{
|
|
{
|
|
|
|
|
+ SDL_VideoDevice *video = SDL_GetVideoDevice();
|
|
|
|
|
+ SDL_Window *parent_window = NULL;
|
|
|
SDL_MessageBoxControlsX11 controls;
|
|
SDL_MessageBoxControlsX11 controls;
|
|
|
SDL_MessageBoxCallbackDataX11 data;
|
|
SDL_MessageBoxCallbackDataX11 data;
|
|
|
const SDL_MessageBoxColor *colorhints;
|
|
const SDL_MessageBoxColor *colorhints;
|
|
@@ -305,10 +307,14 @@ static bool X11_ShowMessageBoxImpl(const SDL_MessageBoxData *messageboxdata, int
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* Create window */
|
|
/* Create window */
|
|
|
|
|
+ if (messageboxdata->window && SDL_strcmp(video->name, "x11") == 0) {
|
|
|
|
|
+ // Only use the window as a parent if it is from the X11 driver.
|
|
|
|
|
+ parent_window = messageboxdata->window;
|
|
|
|
|
+ }
|
|
|
#if SDL_FORK_MESSAGEBOX
|
|
#if SDL_FORK_MESSAGEBOX
|
|
|
- controls.window = X11Toolkit_CreateWindowStruct(messageboxdata->window, NULL, SDL_TOOLKIT_WINDOW_MODE_X11_DIALOG, colorhints, true);
|
|
|
|
|
|
|
+ controls.window = X11Toolkit_CreateWindowStruct(parent_window, NULL, SDL_TOOLKIT_WINDOW_MODE_X11_DIALOG, colorhints, true);
|
|
|
#else
|
|
#else
|
|
|
- controls.window = X11Toolkit_CreateWindowStruct(messageboxdata->window, NULL, SDL_TOOLKIT_WINDOW_MODE_X11_DIALOG, colorhints, false);
|
|
|
|
|
|
|
+ controls.window = X11Toolkit_CreateWindowStruct(parent_window, NULL, SDL_TOOLKIT_WINDOW_MODE_X11_DIALOG, colorhints, false);
|
|
|
#endif
|
|
#endif
|
|
|
controls.window->cb_data = &controls;
|
|
controls.window->cb_data = &controls;
|
|
|
controls.window->cb_on_scale_change = X11_OnMessageBoxScaleChange;
|
|
controls.window->cb_on_scale_change = X11_OnMessageBoxScaleChange;
|