Make sure new windows have mouse and keyboard focus if there's no windowing system
This commit is contained in:
@@ -2131,10 +2131,16 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
|||||||
parent->first_child = window;
|
parent->first_child = window;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_this->CreateSDLWindow && _this->CreateSDLWindow(_this, window, props) < 0) {
|
if (_this->CreateSDLWindow) {
|
||||||
|
if (_this->CreateSDLWindow(_this, window, props) < 0) {
|
||||||
SDL_DestroyWindow(window);
|
SDL_DestroyWindow(window);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* No windowing system, make sure the new window has focus */
|
||||||
|
SDL_SetMouseFocus(window);
|
||||||
|
SDL_SetKeyboardFocus(window);
|
||||||
|
}
|
||||||
|
|
||||||
/* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
|
/* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
|
||||||
* but it's important or window focus will get broken on windows!
|
* but it's important or window focus will get broken on windows!
|
||||||
|
|||||||
Reference in New Issue
Block a user