Explorar el Código

Limit live-resize redraws to only happen during actual live-resize situations.

Sasha Szpakowski hace 1 mes
padre
commit
e7dd8c84ba
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/modules/event/sdl/Event.cpp

+ 2 - 1
src/modules/event/sdl/Event.cpp

@@ -98,7 +98,8 @@ static bool SDLCALL watchAppEvents(void *udata, SDL_Event *event)
 		}
 		break;
 	case SDL_EVENT_WINDOW_EXPOSED:
-		if (eventModule != nullptr && SDL_IsMainThread() && eventModule->allowModalDraws())
+		// Only redraw during live-resize events (data1 is 1 in that situation).
+		if (event->window.data1 == 1 && eventModule != nullptr && SDL_IsMainThread() && eventModule->allowModalDraws())
 			eventModule->modalDraw();
 		break;
 	default: