Force the runtime to prioritize the main thread and keep things smooth.

This commit is contained in:
Paul Chote
2013-04-06 02:59:34 +13:00
parent 4bc5d06c19
commit 995b4c73d9

View File

@@ -155,6 +155,9 @@ namespace OpenRA.Widgets
Previews.Add(uid, bitmap);
cacheUids.Dequeue();
}
// Yuck... But this helps the UI Jank when opening the map selector significantly.
Thread.Sleep(50);
}
}
@@ -172,7 +175,6 @@ namespace OpenRA.Widgets
if (previewLoaderThread == null || !previewLoaderThread.IsAlive)
{
previewLoaderThread = new Thread(LoadAsyncInternal);
previewLoaderThread.Priority = ThreadPriority.Lowest;
previewLoaderThread.Start();
}
}