<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">With latest master of Kirigami we are observing an odd problem in Subsurface-mobile.</div><div class=""><br class=""></div><div class="">This happens in landscape mode (at least I haven't been able to reproduce this in portrait mode).</div><div class=""><br class=""></div><div class="">Our page stack has in position zero a vertical listview (dive list). If you select one of the dives in this listview, that opens a secondary listview in position one of the page stack, this one is horizontal.</div><div class="">If you swipe left or right to flip from dive to dive in that horizontal listview, <span style="font-family: Menlo; font-size: 11px;" class="">syncIndexWithPosition </span>gets called on the page stack with mapped.x(1024), actualRoot.currentItem.width(1024) and actualRoot.width(1024). This is where I don't quite understand how the code is supposed to work:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            var mapped = actualRoot.currentItem.mapToItem(mainFlickable, 0, 0);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">            if (mapped.x >= 0 && mapped.x + actualRoot.currentItem.width <= actualRoot.width) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                return;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">So the first test fails as mapped.x + currentItem.width is 2048 > width of 1024</span></div><div style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">what does that mean? what are we checking here for?</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><div style="font-family: Helvetica; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">Then the code loops through the page stack to find an item that can be mapped on the screen - which always picks the first item in the page stack.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></span></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            //search the last page to kinda fit</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            for (var i = Engine.pageStack.length - 1; i >= 0; --i) {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                var item = Engine.pageStack[i];</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                var mapped = item.mapToItem(mainFlickable, 0, 0, item.width, item.height);</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                if (mapped.x < item.width /2 && (mapped.x+mapped.width) <= actualRoot.width) {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class="">                    actualRoot.currentIndex = i;<span style="font-variant-ligatures: no-common-ligatures" class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                    break;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">                }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">            }</span></div></div><div class=""><br class=""></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">As a result, trying to move from one item to the next in the inner horizontal listview makes us jump back to page zero (which is the vertical outer listview).</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So I tried to figure out why this happens in landscape mode and not in portrait mode... the difference that I could find is that in landscape mode for some reason we trigger the scrollEventCompressTimer but in portrait mode we don't ?!?</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Adding a ton more print statements leads me to this:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">in landscape mode we end up in the page stack's onContentXChanged handler (why?) with dragging = false. And that causes us to restart the scrollEventCompressTimer, even though we are scrolling only the inner listview and not the page stack. But in portrait mode we never trigger the page stack's onContentXChanged when swiping left and right between dives.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Does this make sense to anyone? Any idea how to fix this?</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">/D</span></div></body></html>