mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Process Qt events in the SDL loop
This commit is contained in:
@@ -908,10 +908,13 @@ void Session::exec(int displayOriginX, int displayOriginY)
|
|||||||
|
|
||||||
int currentDisplayIndex = SDL_GetWindowDisplayIndex(m_Window);
|
int currentDisplayIndex = SDL_GetWindowDisplayIndex(m_Window);
|
||||||
|
|
||||||
// Hijack this thread to be the SDL main thread. We have to do this
|
// Hijack this thread to be the SDL main thread, but also process
|
||||||
// because we want to suspend all Qt processing until the stream is over.
|
// Qt events in each iteration to allow us to use Qt classes.
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
// Process Qt events
|
||||||
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
// We explicitly use SDL_PollEvent() and SDL_Delay() because
|
// We explicitly use SDL_PollEvent() and SDL_Delay() because
|
||||||
// SDL_WaitEvent() has an internal SDL_Delay(10) inside which
|
// SDL_WaitEvent() has an internal SDL_Delay(10) inside which
|
||||||
// blocks this thread too long for high polling rate mice and high
|
// blocks this thread too long for high polling rate mice and high
|
||||||
|
|||||||
Reference in New Issue
Block a user