We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2804

Summary: Mouse down event. Triggered when window active event ocure by clicking on window title.
Product: SDL Reporter: Alex <codeservice>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2    
Version: 2.0.3   
Hardware: x86   
OS: Windows 7   

Description Alex 2014-12-05 19:48:34 UTC
Step to reproduce:
1. Run SDL2 windowed application with mouse down capture event.
2. Click on something else on your desctop to lose app focus.
3. Click back on SDL2 app window title bar to activate it.
Mouse down event should not trigger when you click on window title bar.

Problem may relay to file: SDL_windowsevents.c
Code:
    case WM_ACTIVATE:
        {
            BOOL minimized;

            minimized = HIWORD(wParam);
            if (!minimized && (LOWORD(wParam) != WA_INACTIVE)) {
                SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
                if (SDL_GetKeyboardFocus() != data->window) {
                    SDL_SetKeyboardFocus(data->window);
                }
                WIN_UpdateClipCursor(data->window);
                WIN_CheckAsyncMouseRelease(data);//PROBLEM HERE!!!!!!
.............

Call of "WIN_CheckAsyncMouseRelease(data);" lead to this mouse down event
Quick solution is to simply comment this line: WIN_CheckAsyncMouseRelease(data);//PROBLEM HERE!!!!!!
But can brake something else, not sure what purpose of this code for window activation ... 

Can be the same bug described here: 
https://bugzilla.libsdl.org/show_bug.cgi?id=2195