Neither Windows nor Linux allow dragging out of the window without some sort of mouse capture, so for now punt on that behavior.
This commit is contained in:
parent
138cd7fa11
commit
80c4c387ed
1 changed files with 14 additions and 0 deletions
|
@ -130,7 +130,21 @@ SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint8 buttonstate)
|
||||||
} else {
|
} else {
|
||||||
inWindow = SDL_TRUE;
|
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) {
|
if (!inWindow && !buttonstate) {
|
||||||
|
#else
|
||||||
|
if (!inWindow) {
|
||||||
|
#endif
|
||||||
if (window == mouse->focus) {
|
if (window == mouse->focus) {
|
||||||
#ifdef DEBUG_MOUSE
|
#ifdef DEBUG_MOUSE
|
||||||
printf("Mouse left window, synthesizing focus lost event\n");
|
printf("Mouse left window, synthesizing focus lost event\n");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue