Browse Source

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

Sasha Szpakowski 1 month ago
parent
commit
e7dd8c84ba
1 changed files with 2 additions and 1 deletions
  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: