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.plasma.private.mobileshell.state as MobileShellState
import org.kde.private.mobile.homescreen.folio 1.0 as Folio 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.windowplugin as WindowPlugin
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
ContainmentItem { ContainmentItem {
id: root id: root
@ -74,12 +75,22 @@ ContainmentItem {
function homeAction() { function homeAction() {
const isInWindow = (!WindowPlugin.WindowUtil.isShowingDesktop && WindowPlugin.WindowMaximizedTracker.showingWindow); const isInWindow = (!WindowPlugin.WindowUtil.isShowingDesktop && WindowPlugin.WindowMaximizedTracker.showingWindow);
// Always close action drawer
if (MobileShellState.ShellDBusClient.isActionDrawerOpen) {
MobileShellState.ShellDBusClient.closeActionDrawer();
}
if (isInWindow) { if (isInWindow) {
Folio.HomeScreenState.closeFolder(); // only minimize windows and go to homescreen when not in docked mode
Folio.HomeScreenState.closeSearchWidget(); if (!ShellSettings.Settings.convergenceModeEnabled) {
Folio.HomeScreenState.closeAppDrawer(); Folio.HomeScreenState.closeFolder();
Folio.HomeScreenState.goToPage(0); Folio.HomeScreenState.closeSearchWidget();
} else { Folio.HomeScreenState.closeAppDrawer();
Folio.HomeScreenState.goToPage(0);
WindowPlugin.WindowUtil.isShowingDesktop = true;
}
} else { // if we are on the homescreen
switch (Folio.HomeScreenState.viewState) { switch (Folio.HomeScreenState.viewState) {
case Folio.HomeScreenState.PageView: case Folio.HomeScreenState.PageView:
if (Folio.HomeScreenState.currentPage === 0) { if (Folio.HomeScreenState.currentPage === 0) {