mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-02 22:06:14 +00:00
Move refreshDisplay() after test window creation
SDL invalidates cached display modes after a window creation, so this avoids paying a second mode enumeration cost when the user enters the settings page.
This commit is contained in:
@@ -184,9 +184,6 @@ void SystemProperties::startAsyncLoad()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update display related attributes (max FPS, native resolution, etc).
|
|
||||||
refreshDisplays();
|
|
||||||
|
|
||||||
testWindow = SDL_CreateWindow("", 0, 0, 1280, 720,
|
testWindow = SDL_CreateWindow("", 0, 0, 1280, 720,
|
||||||
SDL_WINDOW_HIDDEN | StreamUtils::getPlatformWindowFlags());
|
SDL_WINDOW_HIDDEN | StreamUtils::getPlatformWindowFlags());
|
||||||
if (!testWindow) {
|
if (!testWindow) {
|
||||||
@@ -204,6 +201,13 @@ void SystemProperties::startAsyncLoad()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update display related attributes (max FPS, native resolution, etc).
|
||||||
|
//
|
||||||
|
// NB: SDL3 will forcefully refresh displays when a window is created,
|
||||||
|
// so we place this after the window creation to ensure we don't pay
|
||||||
|
// the penalty for mode enumeration twice.
|
||||||
|
refreshDisplays();
|
||||||
|
|
||||||
systemPropertyQueryThread = new SystemPropertyQueryThread(this);
|
systemPropertyQueryThread = new SystemPropertyQueryThread(this);
|
||||||
systemPropertyQueryThread->start();
|
systemPropertyQueryThread->start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user