Cocoa: send a MOUSEMOTION event when warping cursor from outside the window.
Fixes Bugzilla #2984. --HG-- extra : rebase_source : 9623b7e6552e4b543f22331f4caa31902e8b27a9
This commit is contained in:
parent
18be5eb77d
commit
626cc29bae
1 changed files with 4 additions and 0 deletions
|
@ -230,6 +230,10 @@ Cocoa_WarpMouseGlobal(int x, int y)
|
|||
static void
|
||||
Cocoa_WarpMouse(SDL_Window * window, int x, int y)
|
||||
{
|
||||
/* pretend we have the mouse focus, even if we don't, so
|
||||
Cocoa_WarpMouseGlobal() will properly fake a mouse motion event. */
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
mouse->focus = window;
|
||||
Cocoa_WarpMouseGlobal(x + window->x, y + window->y);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue