shift-shell/kwin/mobiletaskswitcher/package/contents/ui/main.qml
Micah Stanley 013d034516 Gesture Navigation: Disable Gestures When Action Drawer, Notification Popup Drawer, or VolumeOSD are Visible
Disables gesture navigation when Action Drawer, Notification Popup Drawer, or VolumeOSD are visible as activating the task switcher in these situation can feel a bit weird.

Note:
~~Draft for in till I can get side loading working again so I can test it on device.~~

Still can't seem to get side loading working quite yet. Though, I did run the test I could from my laptop and it does seems to be working fine, so I will be removing this from draft.
2025-03-19 01:21:46 +00:00

39 lines
No EOL
1.1 KiB
QML

// SPDX-FileCopyrightText: 2025 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
import QtQuick
import org.kde.kwin
import org.kde.plasma.private.mobileshell.taskswitcherplugin as TaskSwitcherPlugin
import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings
import org.kde.plasma.private.mobileshell.state as MobileShellState
SceneEffect {
id: root
// Created per screen
delegate: TaskSwitcher {
id: taskSwitcher
state: taskSwitcherState
}
ShortcutHandler {
name: 'Mobile Task Switcher'
text: i18n('Toggle Mobile Task Switcher')
sequence: 'Meta+C'
onActivated: taskSwitcherState.toggle()
}
TaskSwitcherPlugin.MobileTaskSwitcherState {
id: taskSwitcherState
gestureEnabled: !ShellSettings.Settings.navigationPanelEnabled && !MobileShellState.ShellDBusClient.isActionDrawerOpen && !MobileShellState.ShellDBusClient.isVolumeOSDOpen && !MobileShellState.ShellDBusClient.isNotificationPopupDrawerOpen
Component.onCompleted: {
// Initialize with effect
taskSwitcherState.init(root);
}
}
}