homescreens/folio: Fix start button behaviour, ensure windows are minimized and it's not triggered in docked mode

BUG: 482870
This commit is contained in:
Devin Lin 2024-03-08 10:38:59 -05:00
parent 85061c3d9f
commit d2f63e6d9a

View file

@ -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) {
// 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);
} else {
WindowPlugin.WindowUtil.isShowingDesktop = true;
}
} else { // if we are on the homescreen
switch (Folio.HomeScreenState.viewState) {
case Folio.HomeScreenState.PageView:
if (Folio.HomeScreenState.currentPage === 0) {