on xenial help sign in
Bug swap

It seems like, for the first interaction with Unity8's Drawer in a session, we can pick any two: * Horizontal drag (dismiss) * Vertical drag (scroll) * Click (Launch) This is due to what may be a bug where a Flickable won't steal the mouse event from its parented MouseArea... but only the first event after its creation. Our previous behavior allowed horizontal drag and click interactions. This change allows vertical drag and click interactions. Swapping one bug for another.

commit3e105e0d923a7af0d7281e9f9184cae390d87931 authorDalton Durst <d@ltondur.st> dateTue 26 Mar 2019, 19:55 (8 years ago) parent74e0f74
1 file changed+8−9
qml/Launcher/Drawer.qml+8−9
qml/Launcher/Drawer.qml+8−9
@@ -32,6 +32,7 @@ FocusScope {
3232
3333 signal applicationSelected(string appId)
3434
35+ property bool firstOpen: true
3536 property bool draggingHorizontally: false
3637 property int dragDistance: 0
3738
@@ -190,11 +191,17 @@ FocusScope {
190191 }
191192
192193 MouseArea {
194+ id: horizontalDragDetector
193195 parent: listLoader.item ? listLoader.item : null
194196 anchors.fill: parent
195197 propagateComposedEvents: true
196198 property int oldX: 0
197199 onPressed: {
200+ if (root.firstOpen) {
201+ mouse.accepted = false;
202+ root.firstOpen = false;
203+ return;
204+ }
198205 oldX = mouseX;
199206 }
200207 onMouseXChanged: {
@@ -203,7 +210,6 @@ FocusScope {
203210 if (!root.draggingHorizontally) {
204211 return;
205212 }
206− propagateComposedEvents = false;
207213 parent.interactive = false;
208214 root.dragDistance += diff;
209215 oldX = mouseX
@@ -215,13 +221,6 @@ FocusScope {
215221 root.draggingHorizontally = false;
216222 parent.interactive = true;
217223 }
218− reactivateTimer.start();
219− }
220−
221− Timer {
222− id: reactivateTimer
223− interval: 0
224− onTriggered: parent.propagateComposedEvents = true;
225224 }
226225 }
227226
@@ -318,7 +317,7 @@ FocusScope {
318317 anchors { left: parent.left; top: categoryNameLabel.bottom; right: parent.right; topMargin: units.gu(1) }
319318 height: rows * delegateHeight
320319
321− interactive: true
320+ interactive: false
322321 focus: index == aToZListView.currentIndex
323322
324323 model: AppDrawerProxyModel {