1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +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()
{
SDL_Event evnt;
SDL_Event event;
SDL_MouseMotionEvent sme = {SDL_MOUSEMOTION, 0, 0, 0, 0, 0, 0, 0, 0};
int x, y;
@ -427,9 +427,8 @@ void CGuiHandler::fakeMouseMove()
sme.x = x;
sme.y = y;
evnt.motion = sme;
current = &evnt;
handleMouseMotion(&evnt);
event.motion = sme;
SDL_PushEvent(&event);
}
void CGuiHandler::renderFrame()