MacOSX 10.10 Yosemite, mouse down on the window title bar but no mouse up [SOLVED]

Hi all,

I add a problem running SDL2 on MacOSX that whenever I used the title
bar to drag the window, the application would receive a mouse down event
but not a mouse up, leaving the button “pressed”.

I thought it was this bug (and wrote some more details there):

but it seems my problem is MacOS specific and that bug was on Windows.

Adding the code to SDL_cocoawindow.m -> MouseDown that is present in
SDL_cocoamouse.m -> Cocoa_HandleMouseEvent to filter events outside the
window’s client area:

/* Ignore events that aren’t inside the client area (i.e. title bar.) */
if ([theEvent window]) {
NSRect windowRect = theEvent window] contentView] frame];
if (!NSPointInRect([theEvent locationInWindow], windowRect)) {

fixes this for me.

If this is the correct fix, I can submit a proper patch (btw, is this
the correct mailing list for that?).

Thanks in advance,–
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601

Pointy-Haired Boss: I don’t see anything that could stand in our way.
Dilbert: Sanity? Reality? The laws of physics?