From 646be07c6c7cc17ea01b8a3ff66cbc900585715d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20B=C3=BCchi?= Date: Mon, 19 Feb 2024 04:03:58 +0000 Subject: [PATCH] potential fix for gesture-only mode not working call reconfigure in mobiletaskswitcher constructor to make it set the touch border. this fixes the gesture-only mode in my setup, though one oddity remains: it only starts working after using the action drawer once - that may be an issue with my dev setup though. --- .../mobileshellsettings.cpp | 3 +-- kcms/mobileshell/ui/main.qml | 25 +++++++++---------- .../mobiletaskswitchereffect.cpp | 1 + 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/components/shellsettingsplugin/mobileshellsettings.cpp b/components/shellsettingsplugin/mobileshellsettings.cpp index 6d2893d1..b47e0a56 100644 --- a/components/shellsettingsplugin/mobileshellsettings.cpp +++ b/components/shellsettingsplugin/mobileshellsettings.cpp @@ -91,8 +91,7 @@ void MobileShellSettings::setNavigationPanelEnabled(bool navigationPanelEnabled) group.writeEntry("navigationPanelEnabled", navigationPanelEnabled, KConfigGroup::Notify); m_config->sync(); - // TODO: Gesture only mode setting is disabled until we get the kwin effect gesture working: https://invent.kde.org/plasma/plasma-mobile/-/issues/300 - // updateNavigationBarsInPlasma(navigationPanelEnabled); + updateNavigationBarsInPlasma(navigationPanelEnabled); } bool MobileShellSettings::alwaysShowKeyboardToggleOnNavigationPanel() const diff --git a/kcms/mobileshell/ui/main.qml b/kcms/mobileshell/ui/main.qml index 8e70b7cc..a24844a3 100644 --- a/kcms/mobileshell/ui/main.qml +++ b/kcms/mobileshell/ui/main.qml @@ -54,20 +54,19 @@ KCM.SimpleKCM { } FormCard.FormCard { - // TODO: Gesture only mode setting is disabled until we get the kwin effect gesture working: https://invent.kde.org/plasma/plasma-mobile/-/issues/300 - // FormCard.FormSwitchDelegate { - // id: gestureDelegate - // text: i18n("Gesture-only Mode") - // description: i18n("Whether to hide the navigation panel.") - // checked: !ShellSettings.Settings.navigationPanelEnabled - // onCheckedChanged: { - // if (checked != !ShellSettings.Settings.navigationPanelEnabled) { - // ShellSettings.Settings.navigationPanelEnabled = !checked; - // } - // } - // } + FormCard.FormSwitchDelegate { + id: gestureDelegate + text: i18n("Gesture-only Mode") + description: i18n("Whether to hide the navigation panel.") + checked: !ShellSettings.Settings.navigationPanelEnabled + onCheckedChanged: { + if (checked != !ShellSettings.Settings.navigationPanelEnabled) { + ShellSettings.Settings.navigationPanelEnabled = !checked; + } + } + } - // FormCard.FormDelegateSeparator { visible: keyboardToggleDelegate.visible; above: gestureDelegate; below: keyboardToggleDelegate } + FormCard.FormDelegateSeparator { visible: keyboardToggleDelegate.visible; above: gestureDelegate; below: keyboardToggleDelegate } FormCard.FormSwitchDelegate { id: keyboardToggleDelegate diff --git a/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp b/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp index 22cecb0a..94edd46b 100644 --- a/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp +++ b/kwin/mobiletaskswitcher/mobiletaskswitchereffect.cpp @@ -51,6 +51,7 @@ MobileTaskSwitcherEffect::MobileTaskSwitcherEffect() setSource(QUrl::fromLocalFile( QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kwin/effects/mobiletaskswitcher/qml/TaskSwitcher.qml")))); + reconfigure(ReconfigureFlag::ReconfigureAll); } MobileTaskSwitcherEffect::~MobileTaskSwitcherEffect()