1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

CGuiHandler: use SDL_PushEvent in fakeMouseMove to avoid crashes

Somehow this worked on other platforms, but on macOS it's cause constant crashes.
This commit is contained in:
Arseniy Shestakov
2017-09-10 23:13:19 +03:00
committed by ArseniyShestakov
parent feba7e1979
commit 986fc08b1e

View File

@ -419,7 +419,7 @@ void CGuiHandler::handleMoveInterested(const SDL_MouseMotionEvent & motion)
void CGuiHandler::fakeMouseMove() void CGuiHandler::fakeMouseMove()
{ {
SDL_Event evnt; SDL_Event event;
SDL_MouseMotionEvent sme = {SDL_MOUSEMOTION, 0, 0, 0, 0, 0, 0, 0, 0}; SDL_MouseMotionEvent sme = {SDL_MOUSEMOTION, 0, 0, 0, 0, 0, 0, 0, 0};
int x, y; int x, y;
@ -427,9 +427,8 @@ void CGuiHandler::fakeMouseMove()
sme.x = x; sme.x = x;
sme.y = y; sme.y = y;
evnt.motion = sme; event.motion = sme;
current = &evnt; SDL_PushEvent(&event);
handleMouseMotion(&evnt);
} }
void CGuiHandler::renderFrame() void CGuiHandler::renderFrame()