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:
committed by
ArseniyShestakov
parent
feba7e1979
commit
986fc08b1e
@ -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()
|
||||
|
Reference in New Issue
Block a user