diff --git a/components/mobileshell/CMakeLists.txt b/components/mobileshell/CMakeLists.txt index 946d0729..263d716b 100644 --- a/components/mobileshell/CMakeLists.txt +++ b/components/mobileshell/CMakeLists.txt @@ -80,6 +80,8 @@ ecm_target_qml_sources(mobileshellplugin SOURCES qml/popups/notifications/NotificationPopupProvider.qml qml/popups/notifications/PulseAudio.qml + qml/popups/kscreenosd/KScreenOSDProvider.qml + qml/popups/volumeosd/AudioApplet.qml qml/popups/volumeosd/DeviceListItem.qml qml/popups/volumeosd/icon.js diff --git a/components/mobileshell/qml/popups/PopupProviderLoader.qml b/components/mobileshell/qml/popups/PopupProviderLoader.qml index 8390360b..4dbf84ad 100644 --- a/components/mobileshell/qml/popups/PopupProviderLoader.qml +++ b/components/mobileshell/qml/popups/PopupProviderLoader.qml @@ -23,6 +23,9 @@ Item { if (!volumeOSD.active) { volumeOSD.active = true; } + if (!kscreenOSD.active) { + kscreenOSD.active = true; + } if (!notifications.active) { notifications.active = true; } @@ -38,6 +41,13 @@ Item { } } + Loader { + id: kscreenOSD + sourceComponent: Component { + MobileShell.KScreenOSDProvider {} + } + } + Loader { id: notifications sourceComponent: Component { diff --git a/components/mobileshell/qml/popups/kscreenosd/KScreenOSDProvider.qml b/components/mobileshell/qml/popups/kscreenosd/KScreenOSDProvider.qml new file mode 100644 index 00000000..9e8ff5f1 --- /dev/null +++ b/components/mobileshell/qml/popups/kscreenosd/KScreenOSDProvider.qml @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: 2025 Sebastian Kügler +// SPDX-License-Identifier: GPL-2.0-or-later + +import QtQuick +import QtQml + +import org.kde.plasma.quicksetting.kscreenosd 1.0 +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings + + +/** + * This switches between docked / convergence mode and normal when a monitor + * is plugged in or unplugged. + */ +QtObject { + id: component + + property var apiListener: Connections { + target: KScreenOSDUtil + function onOutputsChanged() { + console.log("KScreenOSDProvider convergenceModeEnabled: " + + (KScreenOSDUtil.outputs > 1 ? "true" : "false")); + ShellSettings.Settings.convergenceModeEnabled = KScreenOSDUtil.outputs > 1; + } + } +}