|
@@ -35,6 +35,7 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) : QQuickWindow(parent), m_debugL
|
|
|
InputComponent::Get().registerHostCommand("toggleDebug", this, "toggleDebug");
|
|
|
InputComponent::Get().registerHostCommand("reload", this, "reloadWeb");
|
|
|
InputComponent::Get().registerHostCommand("fullscreen", this, "toggleFullscreen");
|
|
|
+ InputComponent::Get().registerHostCommand("alwaysOnTop", this, "toggleAlwaysOnTop");
|
|
|
|
|
|
#ifdef TARGET_RPI
|
|
|
// On RPI, we use dispmanx layering - the video is on a layer below Konvergo,
|
|
@@ -71,6 +72,9 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) : QQuickWindow(parent), m_debugL
|
|
|
updateFullscreenState(false);
|
|
|
#endif
|
|
|
|
|
|
+ // Check the always on top setting and activate it if necessary.
|
|
|
+ updateAlwaysOnTopState();
|
|
|
+
|
|
|
emit enableVideoWindowSignal();
|
|
|
}
|
|
|
|
|
@@ -209,6 +213,15 @@ void KonvergoWindow::setFullScreen(bool enable)
|
|
|
SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "fullscreen", enable);
|
|
|
}
|
|
|
|
|
|
+///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
+void KonvergoWindow::setAlwaysOnTop(bool enable)
|
|
|
+{
|
|
|
+ QLOG_DEBUG() << "setting always on top = " << enable;
|
|
|
+
|
|
|
+ // Update the settings value.
|
|
|
+ SettingsComponent::Get().setValue(SETTINGS_SECTION_MAIN, "alwaysOnTop", enable);
|
|
|
+}
|
|
|
+
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
void KonvergoWindow::playerWindowVisible(bool visible)
|
|
|
{
|
|
@@ -227,6 +240,11 @@ void KonvergoWindow::updateMainSectionSettings(const QVariantMap& values)
|
|
|
SystemComponent::Get().setCursorVisibility(!SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "disablemouse").toBool());
|
|
|
}
|
|
|
|
|
|
+ if (values.find("alwaysOnTop") != values.end())
|
|
|
+ {
|
|
|
+ updateAlwaysOnTopState();
|
|
|
+ }
|
|
|
+
|
|
|
if (values.find("fullscreen") == values.end())
|
|
|
return;
|
|
|
|
|
@@ -252,6 +270,27 @@ void KonvergoWindow::updateFullscreenState(bool saveGeo)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
+void KonvergoWindow::updateAlwaysOnTopState()
|
|
|
+{
|
|
|
+ QLOG_DEBUG() << "Changing always-on-top state";
|
|
|
+ Qt::WindowFlags forceOnTopFlags = Qt::WindowStaysOnTopHint;
|
|
|
+#ifdef Q_OS_LINUX
|
|
|
+ forceOnTopFlags = forceOnTopFlags | Qt::X11BypassWindowManagerHint;
|
|
|
+#endif
|
|
|
+
|
|
|
+ if(SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "alwaysOnTop").toBool())
|
|
|
+ {
|
|
|
+ setFlags(flags() | forceOnTopFlags);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ setFlags(flags() & ~forceOnTopFlags);
|
|
|
+ }
|
|
|
+
|
|
|
+ show();
|
|
|
+}
|
|
|
+
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
|
|
|
{
|