Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Neither Windows nor Linux allow dragging out of the window without so…
…me sort of mouse capture, so for now punt on that behavior.
  • Loading branch information
slouken committed Nov 8, 2012
1 parent 3050f6f commit 646d5564c586d750f1e58cf3bf3c13ec97d7c3b0
Showing with 14 additions and 0 deletions.
  1. +14 −0 src/events/SDL_mouse.c
@@ -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");

0 comments on commit 646d556

Please sign in to comment.