diff --git a/app/gui/SettingsView.qml b/app/gui/SettingsView.qml
index a2300791..508a3215 100644
--- a/app/gui/SettingsView.qml
+++ b/app/gui/SettingsView.qml
@@ -230,13 +230,26 @@ ScrollView {
}
}
- CheckBox {
- id: fullScreenCheck
- text: "Full-screen"
- font.pointSize: 12
- checked: prefs.fullScreen
- onCheckedChanged: {
- prefs.fullScreen = checked
+ Row {
+ CheckBox {
+ id: fullScreenCheck
+ text: "Full-screen"
+ font.pointSize: 12
+ checked: prefs.fullScreen
+ onCheckedChanged: {
+ prefs.fullScreen = checked
+ }
+ }
+
+ CheckBox {
+ id: vsyncCheck
+ text: "Enable V-Sync"
+ font.pointSize: 12
+ visible: fullScreenCheck.checked
+ checked: prefs.enableVsync
+ onCheckedChanged: {
+ prefs.enableVsync = checked
+ }
}
}
}
diff --git a/app/settings/streamingpreferences.cpp b/app/settings/streamingpreferences.cpp
index ae6bdb7c..8cbf313c 100644
--- a/app/settings/streamingpreferences.cpp
+++ b/app/settings/streamingpreferences.cpp
@@ -9,6 +9,7 @@
#define SER_FPS "fps"
#define SER_BITRATE "bitrate"
#define SER_FULLSCREEN "fullscreen"
+#define SER_VSYNC "vsync"
#define SER_GAMEOPTS "gameopts"
#define SER_HOSTAUDIO "hostaudio"
#define SER_MULTICONT "multicontroller"
@@ -30,6 +31,7 @@ void StreamingPreferences::reload()
fps = settings.value(SER_FPS, 60).toInt();
bitrateKbps = settings.value(SER_BITRATE, getDefaultBitrate(width, height, fps)).toInt();
fullScreen = settings.value(SER_FULLSCREEN, true).toBool();
+ enableVsync = settings.value(SER_VSYNC, true).toBool();
gameOptimizations = settings.value(SER_GAMEOPTS, true).toBool();
playAudioOnHost = settings.value(SER_HOSTAUDIO, false).toBool();
multiController = settings.value(SER_MULTICONT, true).toBool();
@@ -50,6 +52,7 @@ void StreamingPreferences::save()
settings.setValue(SER_FPS, fps);
settings.setValue(SER_BITRATE, bitrateKbps);
settings.setValue(SER_FULLSCREEN, fullScreen);
+ settings.setValue(SER_VSYNC, enableVsync);
settings.setValue(SER_GAMEOPTS, gameOptimizations);
settings.setValue(SER_HOSTAUDIO, playAudioOnHost);
settings.setValue(SER_MULTICONT, multiController);
diff --git a/app/settings/streamingpreferences.h b/app/settings/streamingpreferences.h
index 9aea8722..b06020d2 100644
--- a/app/settings/streamingpreferences.h
+++ b/app/settings/streamingpreferences.h
@@ -55,6 +55,7 @@ public:
Q_PROPERTY(int fps MEMBER fps NOTIFY displayModeChanged)
Q_PROPERTY(int bitrateKbps MEMBER bitrateKbps NOTIFY bitrateChanged)
Q_PROPERTY(bool fullScreen MEMBER fullScreen NOTIFY fullScreenChanged)
+ Q_PROPERTY(bool enableVsync MEMBER enableVsync NOTIFY enableVsyncChanged)
Q_PROPERTY(bool gameOptimizations MEMBER gameOptimizations NOTIFY gameOptimizationsChanged)
Q_PROPERTY(bool playAudioOnHost MEMBER playAudioOnHost NOTIFY playAudioOnHostChanged)
Q_PROPERTY(bool multiController MEMBER multiController NOTIFY multiControllerChanged)
@@ -68,6 +69,7 @@ public:
int fps;
int bitrateKbps;
bool fullScreen;
+ bool enableVsync;
bool gameOptimizations;
bool playAudioOnHost;
bool multiController;
@@ -79,6 +81,7 @@ signals:
void displayModeChanged();
void bitrateChanged();
void fullScreenChanged();
+ void enableVsyncChanged();
void gameOptimizationsChanged();
void playAudioOnHostChanged();
void multiControllerChanged();
diff --git a/app/streaming/session.cpp b/app/streaming/session.cpp
index cf69b5d3..8ff6dffa 100644
--- a/app/streaming/session.cpp
+++ b/app/streaming/session.cpp
@@ -834,7 +834,7 @@ void Session::exec()
if (!chooseDecoder(m_Preferences.videoDecoderSelection,
m_Window, m_ActiveVideoFormat, m_ActiveVideoWidth,
m_ActiveVideoHeight, m_ActiveVideoFrameRate,
- true, // TODO: User configuration for V-sync
+ m_Preferences.enableVsync,
s_ActiveSession->m_VideoDecoder)) {
SDL_AtomicUnlock(&m_DecoderLock);
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,