Skip to content

Commit

Permalink
Fixed bug 3453 - First mouse button input after a drag and drop event…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
slouken committed Oct 14, 2016
1 parent 8aab39c commit d5ddb3c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/video/windows/SDL_windowsevents.c
Expand Up @@ -401,20 +401,22 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)

minimized = HIWORD(wParam);
if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) {
if (GetAsyncKeyState(VK_LBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_LMASK;
}
if (GetAsyncKeyState(VK_RBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_RMASK;
}
if (GetAsyncKeyState(VK_MBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_MMASK;
}
if (GetAsyncKeyState(VK_XBUTTON1)) {
data->focus_click_pending |= SDL_BUTTON_X1MASK;
}
if (GetAsyncKeyState(VK_XBUTTON2)) {
data->focus_click_pending |= SDL_BUTTON_X2MASK;
if (LOWORD(wParam) == WA_CLICKACTIVE) {
if (GetAsyncKeyState(VK_LBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_LMASK;
}
if (GetAsyncKeyState(VK_RBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_RMASK;
}
if (GetAsyncKeyState(VK_MBUTTON)) {
data->focus_click_pending |= SDL_BUTTON_MMASK;
}
if (GetAsyncKeyState(VK_XBUTTON1)) {
data->focus_click_pending |= SDL_BUTTON_X1MASK;
}
if (GetAsyncKeyState(VK_XBUTTON2)) {
data->focus_click_pending |= SDL_BUTTON_X2MASK;
}
}

SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
Expand Down

0 comments on commit d5ddb3c

Please sign in to comment.