Navigation Menu

Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Neither Windows nor Linux allow dragging out of the window without so…
Browse files Browse the repository at this point in the history
…me sort of mouse capture, so for now punt on that behavior.
  • Loading branch information
slouken committed Nov 8, 2012
1 parent 3050f6f commit 646d556
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/events/SDL_mouse.c
Expand Up @@ -130,7 +130,21 @@ SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint8 buttonstate)
} else {
inWindow = SDL_TRUE;
}

/* Linux doesn't give you mouse events outside your window unless you grab
the pointer.
Windows doesn't give you mouse events outside your window unless you call
SetCapture().
Both of these are slightly scary changes, so for now we'll punt and if the
mouse leaves the window you'll lose mouse focus and reset button state.
*/
#ifdef SUPPORT_DRAG_OUTSIDE_WINDOW
if (!inWindow && !buttonstate) {
#else
if (!inWindow) {
#endif
if (window == mouse->focus) {
#ifdef DEBUG_MOUSE
printf("Mouse left window, synthesizing focus lost event\n");
Expand Down

0 comments on commit 646d556

Please sign in to comment.