Fixed bug 3453 - First mouse button input after a drag and drop event is ignored

Olav Sorensen

After a drag and drop event, any following mouse button input (down/up) doesn't generate an event. Clicking any mouse button a *second* time generates an event like it should.

Further investigation shows that the new SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH logic also causes this issue in other cases, like the first time you open the program and click the mouse.
This commit is contained in:
Sam Lantinga 2016-10-14 08:40:21 -07:00
parent 8aab39cb7d
commit d5ddb3cb91
1 changed files with 16 additions and 14 deletions

View File

@ -401,6 +401,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
minimized = HIWORD(wParam);
if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) {
if (LOWORD(wParam) == WA_CLICKACTIVE) {
if (GetAsyncKeyState(VK_LBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_LMASK;
}
@ -416,6 +417,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (GetAsyncKeyState(VK_XBUTTON2)) {
data->focus_click_pending |= SDL_BUTTON_X2MASK;
}
}
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
if (SDL_GetKeyboardFocus() != data->window) {