mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-29 20:27:12 +01:00
Cocoa: send a MOUSEMOTION event when warping cursor from outside the window.
Fixes Bugzilla #2984.
This commit is contained in:
parent
dbfd4fdd22
commit
5b2ff76c12
@ -230,6 +230,10 @@ Cocoa_WarpMouseGlobal(int x, int y)
|
|||||||
static void
|
static void
|
||||||
Cocoa_WarpMouse(SDL_Window * window, int x, int y)
|
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);
|
Cocoa_WarpMouseGlobal(x + window->x, y + window->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user