Skip to content

Commit dde8f4c

Browse files
committed
fix: improve focus management for wheel scrolling in fullscreen
1. Added scrolledByWheel property to track mouse wheel page navigation 2. Modified focus behavior to always focus first app when scrolling with wheel 3. Fixed inconsistent focus positioning after wheel vs keyboard navigation 4. Reset scrolledByWheel flag after processing to prevent stale state Log: Improved application focus behavior when using mouse wheel to navigate pages in fullscreen mode Influence: 1. Test mouse wheel page navigation in fullscreen mode 2. Verify focus correctly moves to first application after wheel scrolling 3. Compare focus behavior between wheel scrolling and keyboard navigation 4. Test edge cases like scrolling from first to last page and vice versa 5. Verify focus is not lost when switching between different navigation methods fix: 修复全屏模式下滚轮滚动时的焦点管理问题 1. 添加 scrolledByWheel 属性来跟踪鼠标滚轮翻页操作 2. 修改焦点行为,滚轮翻页时始终聚焦到第一个应用 3. 修复滚轮导航和键盘导航后焦点位置不一致的问题 4. 处理完成后重置 scrolledByWheel 标志,防止状态残留 Log: 改进了全屏模式下使用鼠标滚轮翻页时的应用焦点行为 Influence: 1. 测试全屏模式下的鼠标滚轮翻页功能 2. 验证滚轮翻页后焦点是否正确移动到第一个应用 3. 比较滚轮滚动和键盘导航的焦点行为差异 4. 测试边缘情况,如从第一页滚动到最后一页及反向操作 5. 验证在不同导航方法切换时焦点不会丢失 PMS: BUG-337493
1 parent 0187228 commit dde8f4c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

qml/FullscreenFrame.qml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,14 @@ InputEventItem {
252252
if (!searchEdit.focus) { // reset keyboard focus when using mouse to flip page, but keep searchEdit focus
253253
baseLayer.focus = true
254254
}
255+
listviewPage.scrolledByWheel = true
255256
decrementPageIndex(listviewPage)
256257
} else if (toPage > 0) {
257258
flipPageDelay.start()
258259
if (!searchEdit.focus) { // reset keyboard focus when using mouse to flip page, but keep searchEdit focus
259260
baseLayer.focus = true
260261
}
262+
listviewPage.scrolledByWheel = true
261263
incrementPageIndex(listviewPage)
262264
}
263265
}
@@ -375,6 +377,7 @@ InputEventItem {
375377
}
376378

377379
property int previousIndex: -1
380+
property bool scrolledByWheel: false
378381
model: itemPageModel
379382

380383
delegate: FocusScope {
@@ -431,7 +434,11 @@ InputEventItem {
431434
listviewPage.previousIndex = listviewPage.currentIndex
432435
return
433436
}
434-
if (listviewPage.currentIndex + 1 === listviewPage.previousIndex || (listviewPage.previousIndex === 0 && listviewPage.currentIndex === listviewPage.count - 1)) {
437+
// 如果是通过滚轮翻页,始终将焦点设置到第一个应用
438+
if (listviewPage.scrolledByWheel) {
439+
gridViewContainer.setPreviousPageSwitch(false)
440+
listviewPage.scrolledByWheel = false
441+
} else if (listviewPage.currentIndex + 1 === listviewPage.previousIndex || (listviewPage.previousIndex === 0 && listviewPage.currentIndex === listviewPage.count - 1)) {
435442
gridViewContainer.setPreviousPageSwitch(true)
436443
} else {
437444
gridViewContainer.setPreviousPageSwitch(false)

0 commit comments

Comments
 (0)