Explorar o código

CGuiHandler: use SDL_PushEvent in fakeMouseMove to avoid crashes

Somehow this worked on other platforms, but on macOS it's cause constant crashes.
Arseniy Shestakov %!s(int64=8) %!d(string=hai) anos
pai
achega
986fc08b1e
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      client/gui/CGuiHandler.cpp

+ 3 - 4
client/gui/CGuiHandler.cpp

@@ -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()