From 7a1a32724b7235bfe43531f98d00c57aca3be940 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Sun, 26 Dec 2021 00:21:42 -0500 Subject: [PATCH] homescreen: Fix swipe down gesture conflict with taskpanel --- .../qml/private/DragGestureHandler.qml | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml b/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml index 94069f3d..b4c6ba32 100644 --- a/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml +++ b/components/mobilehomescreencomponents/qml/private/DragGestureHandler.qml @@ -52,19 +52,23 @@ DragHandler { } if (__scrollDirection !== DragGestureHandler.Left && __scrollDirection !== DragGestureHandler.Right) { - // if swipe up, scroll app drawer - root.appDrawer.flickable.contentY = Math.min(root.appDrawer.drawerTopMargin, Math.max(0, -translation.y)); - if (translation.y < 0 && MobileShell.TopPanelControls.inSwipe) { - MobileShell.TopPanelControls.endSwipe(); - } - - // if swipe down, scroll top panel - if (translation.y > 0) { - if (!MobileShell.TopPanelControls.inSwipe) { - MobileShell.TopPanelControls.startSwipe(); + // ensure it does not conflict with task switcher + if (!MobileShell.HomeScreenControls.taskSwitcher.visible) { + // if swipe up, scroll app drawer + root.appDrawer.flickable.contentY = Math.min(root.appDrawer.drawerTopMargin, Math.max(0, -translation.y)); + + if (translation.y < 0 && MobileShell.TopPanelControls.inSwipe) { + MobileShell.TopPanelControls.endSwipe(); + } + + // if swipe down, scroll top panel + if (translation.y > 0) { + if (!MobileShell.TopPanelControls.inSwipe) { + MobileShell.TopPanelControls.startSwipe(); + } + MobileShell.TopPanelControls.requestRelativeScroll(translation.y - __oldTranslationY); } - MobileShell.TopPanelControls.requestRelativeScroll(translation.y - __oldTranslationY); } } }