diff --git a/containments/homescreens/folio/package/contents/ui/main.qml b/containments/homescreens/folio/package/contents/ui/main.qml index ea8b58d4..eacc1417 100644 --- a/containments/homescreens/folio/package/contents/ui/main.qml +++ b/containments/homescreens/folio/package/contents/ui/main.qml @@ -40,22 +40,25 @@ MobileShell.HomeScreen { forceActiveFocus(); } - Plasmoid.onActivated: { - // Always close action drawer - if (MobileShell.TopPanelControls.actionDrawerVisible) { - MobileShell.TopPanelControls.closeActionDrawer(); - } - - // Always close the search widget as well - if (searchWidget.isOpen) { - searchWidget.close(); - } - + Plasmoid.onActivated: { // there's a couple of steps: // - minimize windows (only if we are in an app) // - open app drawer // - close app drawer and, if necessary, restore windows - if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) { + if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible + || MobileShell.TopPanelControls.actionDrawerVisible + || searchWidget.isOpen + ) { + // Always close action drawer + if (MobileShell.TopPanelControls.actionDrawerVisible) { + MobileShell.TopPanelControls.closeActionDrawer(); + } + + // Always close the search widget as well + if (searchWidget.isOpen) { + searchWidget.close(); + } + plasmoid.nativeInterface.showingDesktop = true; } else if (homescreen.homeScreenState.currentView === HomeScreenState.PageView) { homescreen.homeScreenState.openAppDrawer(); diff --git a/containments/homescreens/halcyon/package/contents/ui/main.qml b/containments/homescreens/halcyon/package/contents/ui/main.qml index c44d8abe..abf62556 100644 --- a/containments/homescreens/halcyon/package/contents/ui/main.qml +++ b/containments/homescreens/halcyon/package/contents/ui/main.qml @@ -39,22 +39,25 @@ MobileShell.HomeScreen { } } - Plasmoid.onActivated: { - // Always close action drawer - if (MobileShell.TopPanelControls.actionDrawerVisible) { - MobileShell.TopPanelControls.closeActionDrawer(); - } - - // Always close the search widget as well - if (search.isOpen) { - search.close(); - } - + Plasmoid.onActivated: { // there's a couple of steps: // - minimize windows (only if we are in an app) // - open app drawer // - close app drawer and, if necessary, restore windows - if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible) { + if (!plasmoid.nativeInterface.showingDesktop && !MobileShell.HomeScreenControls.homeScreenVisible + || MobileShell.TopPanelControls.actionDrawerVisible + || search.isOpen + ) { + // Always close action drawer + if (MobileShell.TopPanelControls.actionDrawerVisible) { + MobileShell.TopPanelControls.closeActionDrawer(); + } + + // Always close the search widget as well + if (search.isOpen) { + search.close(); + } + plasmoid.nativeInterface.showingDesktop = true; } else if (homescreen.page == 0) { homescreen.page = 1;