mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 06:33:09 +00:00
This popupprovider takes care of automatically enabling and disabling convergence / docked mode when a monitor is plugged in or unplugged. It uses the plugin that is provided with the kscreenosd quicksetting, which essentially notifies of outputs being added and removed. Signed-off-by: Sebastian Kügler <sebas@kde.org>
26 lines
783 B
QML
26 lines
783 B
QML
// SPDX-FileCopyrightText: 2025 Sebastian Kügler <sebas@kde.org>
|
|
// 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;
|
|
}
|
|
}
|
|
}
|