early-access version 1988
This commit is contained in:
13
externals/SDL/src/events/SDL_events.c
vendored
13
externals/SDL/src/events/SDL_events.c
vendored
@@ -596,6 +596,9 @@ SDL_SendWakeupEvent()
|
||||
if (!_this->wakeup_lock || SDL_LockMutex(_this->wakeup_lock) == 0) {
|
||||
if (_this->wakeup_window) {
|
||||
_this->SendWakeupEvent(_this, _this->wakeup_window);
|
||||
|
||||
/* No more wakeup events needed until we enter a new wait */
|
||||
_this->wakeup_window = NULL;
|
||||
}
|
||||
if (_this->wakeup_lock) {
|
||||
SDL_UnlockMutex(_this->wakeup_lock);
|
||||
@@ -785,10 +788,14 @@ SDL_PollEvent(SDL_Event * event)
|
||||
static int
|
||||
SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event * event, int timeout)
|
||||
{
|
||||
/* Release any keys held down from last frame */
|
||||
SDL_ReleaseAutoReleaseKeys();
|
||||
|
||||
for (;;) {
|
||||
/* Pump events on entry and each time we wake to ensure:
|
||||
a) All pending events are batch processed after waking up from a wait
|
||||
b) Waiting can be completely skipped if events are already available to be pumped
|
||||
c) Periodic processing that takes place in some platform PumpEvents() functions happens
|
||||
*/
|
||||
SDL_PumpEvents();
|
||||
|
||||
if (!_this->wakeup_lock || SDL_LockMutex(_this->wakeup_lock) == 0) {
|
||||
int status = SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT);
|
||||
/* If status == 0 we are going to block so wakeup will be needed. */
|
||||
|
7
externals/SDL/src/events/SDL_keyboard.c
vendored
7
externals/SDL/src/events/SDL_keyboard.c
vendored
@@ -605,6 +605,9 @@ SDL_SetKeymap(int start, SDL_Keycode * keys, int length)
|
||||
void
|
||||
SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
|
||||
{
|
||||
if (scancode >= SDL_NUM_SCANCODES) {
|
||||
return;
|
||||
}
|
||||
SDL_scancode_names[scancode] = name;
|
||||
}
|
||||
|
||||
@@ -675,7 +678,7 @@ SDL_SendKeyboardKeyInternal(Uint8 source, Uint8 state, SDL_Scancode scancode)
|
||||
Uint32 type;
|
||||
Uint8 repeat = SDL_FALSE;
|
||||
|
||||
if (scancode == SDL_SCANCODE_UNKNOWN) {
|
||||
if (scancode == SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -800,7 +803,7 @@ SDL_SendKeyboardKeyInternal(Uint8 source, Uint8 state, SDL_Scancode scancode)
|
||||
allowing the user to escape the application */
|
||||
SDL_MinimizeWindow(keyboard->focus);
|
||||
}
|
||||
|
||||
|
||||
return (posted);
|
||||
}
|
||||
|
||||
|
7
externals/SDL/src/events/SDL_mouse.c
vendored
7
externals/SDL/src/events/SDL_mouse.c
vendored
@@ -819,11 +819,10 @@ SDL_SetRelativeMouseMode(SDL_bool enabled)
|
||||
mouse->scale_accum_y = 0.0f;
|
||||
|
||||
if (enabled && focusWindow) {
|
||||
/* Center it in the focused window to prevent clicks from going through
|
||||
* to background windows.
|
||||
*/
|
||||
SDL_SetMouseFocus(focusWindow);
|
||||
SDL_WarpMouseInWindow(focusWindow, focusWindow->w/2, focusWindow->h/2);
|
||||
|
||||
if (mouse->relative_mode_warp)
|
||||
SDL_WarpMouseInWindow(focusWindow, focusWindow->w/2, focusWindow->h/2);
|
||||
}
|
||||
|
||||
if (mouse->focus) {
|
||||
|
Reference in New Issue
Block a user