mirror of https://github.com/encounter/SDL.git
Don't clobber the error in SDL_ShowMessageBox() if one has been set at
the platform level Fixes https://github.com/libsdl-org/SDL/issues/4760
This commit is contained in:
parent
dca5ce4ea3
commit
98c9836287
|
@ -4271,6 +4271,8 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||||
if (!mbdata.message) mbdata.message = "";
|
if (!mbdata.message) mbdata.message = "";
|
||||||
messageboxdata = &mbdata;
|
messageboxdata = &mbdata;
|
||||||
|
|
||||||
|
SDL_ClearError();
|
||||||
|
|
||||||
if (_this && _this->ShowMessageBox) {
|
if (_this && _this->ShowMessageBox) {
|
||||||
retval = _this->ShowMessageBox(_this, messageboxdata, buttonid);
|
retval = _this->ShowMessageBox(_this, messageboxdata, buttonid);
|
||||||
}
|
}
|
||||||
|
@ -4352,8 +4354,12 @@ SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (retval == -1) {
|
if (retval == -1) {
|
||||||
|
const char *error = SDL_GetError();
|
||||||
|
|
||||||
|
if (!*error) {
|
||||||
SDL_SetError("No message system available");
|
SDL_SetError("No message system available");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (current_window) {
|
if (current_window) {
|
||||||
SDL_RaiseWindow(current_window);
|
SDL_RaiseWindow(current_window);
|
||||||
|
|
Loading…
Reference in New Issue