Repository navigation
Conversation
`GetIShellBrowserRecursive` 原先用 `static` 缓存 `GetIShellBrowsers()`, 只在 DFS 完全失败时重扫。资源管理器窗口开关、HWND 回收复用会让缓存匹配到 错误窗口,首次右键读到桌面/上一个位置。改为每次调用新鲜枚举。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
GetIShellBrowserRecursive每次调用都新鲜枚举 shell 窗口,不再用static缓存。
原因
static auto browsers = GetIShellBrowsers()只初始化一次;仅当 DFS 完全失败时才重新扫描。
IShellBrowser会匹配到错误窗口,导致插件读到桌面/上一个位置,要第二次右键才正确。
改动
static,让browsers每次调用都从IShellWindows重新构建。验证
Failed to get IShellBrowser兜底。GetIShellBrowserRecursive~4-9ms,menu_render::create~40-45ms。