diff --git a/components/mobileshell/qml/popups/PopupProviderLoader.qml b/components/mobileshell/qml/popups/PopupProviderLoader.qml index 07d83ba9..8390360b 100644 --- a/components/mobileshell/qml/popups/PopupProviderLoader.qml +++ b/components/mobileshell/qml/popups/PopupProviderLoader.qml @@ -20,9 +20,15 @@ Item { // WARNING: only call this load from within the plasmashell process, because // multiple bindings of the shortcut may break it entirely (hardware volume keys) function load() { - volumeOSD.active = true; - notifications.active = true; - actionButtons.active = true; + if (!volumeOSD.active) { + volumeOSD.active = true; + } + if (!notifications.active) { + notifications.active = true; + } + if (!actionButtons.active) { + actionButtons.active = true; + } } Loader { diff --git a/containments/panel/package/contents/ui/main.qml b/containments/panel/package/contents/ui/main.qml index ed55ba37..cf84d1dc 100644 --- a/containments/panel/package/contents/ui/main.qml +++ b/containments/panel/package/contents/ui/main.qml @@ -136,15 +136,6 @@ ContainmentItem { Component.onCompleted: { root.setWindowProperties(); - - // register dbus - MobileShellState.ShellDBusObject.registerObject(); - - // HACK: we need to initialize the DBus server somewhere, it might as well be here... - // Initialize the volume osd, and volume keys. - // Initialize notification popups. - // Initialize action popup buttons. - MobileShell.PopupProviderLoader.load(); } MobileShell.StartupFeedbackPanelFill { diff --git a/shell/contents/views/Desktop.qml b/shell/contents/views/Desktop.qml index a389f2db..2f2de370 100644 --- a/shell/contents/views/Desktop.qml +++ b/shell/contents/views/Desktop.qml @@ -13,6 +13,9 @@ import org.kde.plasma.shell 2.0 as Shell import org.kde.kquickcontrolsaddons 2.0 import org.kde.kirigami 2.20 as Kirigami +import org.kde.plasma.private.mobileshell as MobileShell +import org.kde.plasma.private.mobileshell.state as MobileShellState + Rectangle { id: root @@ -20,6 +23,24 @@ Rectangle { color: (containment && containment.backgroundHints == PlasmaCore.Types.NoBackground) ? "transparent" : Kirigami.Theme.textColor + Component.onCompleted: { + initializeShellSingletons(); + } + + function initializeShellSingletons() { + console.log('Initializing DBus objects and popup providers...'); + // Note: The calls here must be idempotent (support being called multiple times) + // - this is called every time there is a new desktop containment + + // HACK: we need to initialize the DBus server somewhere in plasmashell, it might as well be here... + MobileShellState.ShellDBusObject.registerObject(); + + // Initialize the volume osd, and volume keys. + // Initialize notification popups. + // Initialize action popup buttons. + MobileShell.PopupProviderLoader.load(); + } + function toggleWidgetExplorer(containment) { console.log("Widget Explorer toggled"); if (widgetExplorerStack.source != "") {