mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 06:30:55 +00:00
Rework session initialization to return to the Qt event loop while connecting
We also display multiple launch warnings at the same time
This commit is contained in:
+9
-11
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QSemaphore>
|
||||
#include <QWindow>
|
||||
#include <QQuickWindow>
|
||||
|
||||
#include <Limelight.h>
|
||||
#include <opus_multistream.h>
|
||||
@@ -96,13 +96,14 @@ class Session : public QObject
|
||||
friend class SdlInputHandler;
|
||||
friend class DeferredSessionCleanupTask;
|
||||
friend class AsyncConnectionStartThread;
|
||||
friend class ExecThread;
|
||||
|
||||
public:
|
||||
explicit Session(NvComputer* computer, NvApp& app, StreamingPreferences *preferences = nullptr);
|
||||
virtual ~Session();
|
||||
|
||||
Q_INVOKABLE void exec(QWindow* qtWindow);
|
||||
Q_INVOKABLE bool initialize(QQuickWindow* qtWindow);
|
||||
Q_INVOKABLE void start();
|
||||
Q_PROPERTY(QStringList launchWarnings MEMBER m_LaunchWarnings NOTIFY launchWarningsChanged);
|
||||
|
||||
static
|
||||
void getDecoderInfo(SDL_Window* window,
|
||||
@@ -132,8 +133,6 @@ signals:
|
||||
|
||||
void displayLaunchError(QString text);
|
||||
|
||||
void displayLaunchWarning(QString text);
|
||||
|
||||
void quitStarting();
|
||||
|
||||
void sessionFinished(int portTestResult);
|
||||
@@ -141,10 +140,10 @@ signals:
|
||||
// Emitted after sessionFinished() when the session is ready to be destroyed
|
||||
void readyForDeletion();
|
||||
|
||||
private:
|
||||
void execInternal();
|
||||
void launchWarningsChanged();
|
||||
|
||||
bool initialize();
|
||||
private:
|
||||
void exec();
|
||||
|
||||
bool startConnectionAsync();
|
||||
|
||||
@@ -256,13 +255,12 @@ private:
|
||||
bool m_AudioDisabled;
|
||||
bool m_AudioMuted;
|
||||
Uint32 m_FullScreenFlag;
|
||||
QWindow* m_QtWindow;
|
||||
bool m_ThreadedExec;
|
||||
QQuickWindow* m_QtWindow;
|
||||
bool m_UnexpectedTermination;
|
||||
SdlInputHandler* m_InputHandler;
|
||||
int m_MouseEmulationRefCount;
|
||||
int m_FlushingWindowEventsRef;
|
||||
QList<QString> m_LaunchWarnings;
|
||||
QStringList m_LaunchWarnings;
|
||||
bool m_ShouldExitAfterQuit;
|
||||
|
||||
bool m_AsyncConnectionSuccess;
|
||||
|
||||
Reference in New Issue
Block a user