Repository navigation
Fix/rdp native cursor ownership - #420
Open
paofu-cium wants to merge 2 commits into
Open
paofu-cium wants to merge 2 commits into
paofu-cium wants to merge 2 commits into
Conversation
Windows 原生 RDP(mstscax)会话里,会话指针由 ActiveX 控件自己绘制并自己 设置光标,navop 既不绘制远端光标也不接管该路径的鼠标输入。但 RemoteCursorState 仍按 protocol == Rdp 认为自己在管理 OS 光标,而 pointer_hovered 在该路径永远为 false(on_hover / on_mouse_move 只对 canvas 路径注册),于是 should_hide_native_cursor() 恒假,sync_native_cursor() 走 restore 分支。 promote_latest() 每帧无条件调用 sync_native_cursor(),因此原生会话下 navop 每帧都执行 SetCursor(IDC_ARROW),与 ActiveX 设置的光标互相覆盖:远端窗口 边框上控件刚把光标换成双向调整箭头,下一帧就被 navop 改回普通箭头,表现为 "鼠标箭头和双向箭头来回变化",光标热点随之漂移,远端窗口边框几乎无法瞄准, 很难真正拖动调整大小。 修改:给 RemoteCursorState 增加 native_cursor_owned,由 render 每帧按 !uses_windows_native_presentation() 同步;未持有所有权时, sync_native_cursor / rehide_native_cursor_after_pointer_move / release_all_images 全部不再触碰 OS 光标。交还所有权时只撤销 navop 自己 施加过的隐藏,避免向原生会话多打一次 SetCursor。 同时给 native_cursor 增加 #[cfg(test)] 调用计数,让"谁持有 OS 光标"变成可 断言的行为而不是仅靠注释。 验证: - cargo test -p remote_desktop_view --lib:264 passed / 0 failed,含新增 native_presentation_does_not_touch_the_os_cursor 与 handing_the_os_cursor_back_only_undoes_a_hide_navap_applied 两条回归用例 - 本机为 Windows 10 家庭版(fDenyTSConnections=1,无入站 RDP 服务),无法 搭建真实 RDP 会话做端到端复现,真机验证仍待有远端主机的环境确认
This branch has not been deployed
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.
native cursor ownership