Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@ InputEventItem {
if (!searchEdit.focus) { // reset keyboard focus when using mouse to flip page, but keep searchEdit focus
baseLayer.focus = true
}
listviewPage.scrolledByWheel = true
decrementPageIndex(listviewPage)
} else if (toPage > 0) {
flipPageDelay.start()
if (!searchEdit.focus) { // reset keyboard focus when using mouse to flip page, but keep searchEdit focus
baseLayer.focus = true
}
listviewPage.scrolledByWheel = true
incrementPageIndex(listviewPage)
}
}
Expand Down Expand Up @@ -375,6 +377,7 @@ InputEventItem {
}

property int previousIndex: -1
property bool scrolledByWheel: false
model: itemPageModel

delegate: FocusScope {
Expand Down Expand Up @@ -431,7 +434,11 @@ InputEventItem {
listviewPage.previousIndex = listviewPage.currentIndex
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): scrolledByWheel can remain stale when currentIndex doesn’t change, causing misclassification on the next index change.

In the early-return path where currentIndex === previousIndex, scrolledByWheel isn’t reset. If a wheel event sets scrolledByWheel = true but doesn’t change the index (e.g., trying to scroll past the first/last page), the flag leaks into the next index change and incorrectly marks it as wheel-driven. Please reset listviewPage.scrolledByWheel in this branch (or any short-circuit path) so the flag only applies to the wheel event that actually changes the index.

return
}
if (listviewPage.currentIndex + 1 === listviewPage.previousIndex || (listviewPage.previousIndex === 0 && listviewPage.currentIndex === listviewPage.count - 1)) {
// 如果是通过滚轮翻页,始终将焦点设置到第一个应用
if (listviewPage.scrolledByWheel) {
gridViewContainer.setPreviousPageSwitch(false)
listviewPage.scrolledByWheel = false
} else if (listviewPage.currentIndex + 1 === listviewPage.previousIndex || (listviewPage.previousIndex === 0 && listviewPage.currentIndex === listviewPage.count - 1)) {
gridViewContainer.setPreviousPageSwitch(true)
} else {
gridViewContainer.setPreviousPageSwitch(false)
Expand Down