From d2f63e6d9a7c5e5299d5f70bff82a81185f17100 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Fri, 8 Mar 2024 10:38:59 -0500 Subject: [PATCH] homescreens/folio: Fix start button behaviour, ensure windows are minimized and it's not triggered in docked mode BUG: 482870 --- .../folio/package/contents/ui/main.qml | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/containments/homescreens/folio/package/contents/ui/main.qml b/containments/homescreens/folio/package/contents/ui/main.qml index 8efaacd7..ab737704 100644 --- a/containments/homescreens/folio/package/contents/ui/main.qml +++ b/containments/homescreens/folio/package/contents/ui/main.qml @@ -16,6 +16,7 @@ import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.private.mobile.homescreen.folio 1.0 as Folio import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin +import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings ContainmentItem { id: root @@ -74,12 +75,22 @@ ContainmentItem { function homeAction() { const isInWindow = (!WindowPlugin.WindowUtil.isShowingDesktop && WindowPlugin.WindowMaximizedTracker.showingWindow); + // Always close action drawer + if (MobileShellState.ShellDBusClient.isActionDrawerOpen) { + MobileShellState.ShellDBusClient.closeActionDrawer(); + } + if (isInWindow) { - Folio.HomeScreenState.closeFolder(); - Folio.HomeScreenState.closeSearchWidget(); - Folio.HomeScreenState.closeAppDrawer(); - Folio.HomeScreenState.goToPage(0); - } else { + // only minimize windows and go to homescreen when not in docked mode + if (!ShellSettings.Settings.convergenceModeEnabled) { + Folio.HomeScreenState.closeFolder(); + Folio.HomeScreenState.closeSearchWidget(); + Folio.HomeScreenState.closeAppDrawer(); + Folio.HomeScreenState.goToPage(0); + + WindowPlugin.WindowUtil.isShowingDesktop = true; + } + } else { // if we are on the homescreen switch (Folio.HomeScreenState.viewState) { case Folio.HomeScreenState.PageView: if (Folio.HomeScreenState.currentPage === 0) {