Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Tools/windows/Tests/ValidationRunner.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3572,6 +3572,7 @@ Start-Sleep -Seconds 60
$uiaLiveGateSource -notmatch 'public static bool RevealSubmenuByKeyboard\(IntPtr popup, IntPtr menu, int position\)' -or
$uiaLiveGateSource -notmatch '\$submenuKeyboardReveal = \[GraphCodeUiaGateState\]::RevealSubmenuByKeyboard\(' -or
$uiaLiveGateSource -notmatch 'real Promote to submenu popup did not open by hover or keyboard' -or
$uiaLiveGateSource -notmatch '(?s)\$reopen = Open-SketchNodeMenu \$title.*?\$reopenKeyboardReveal = \[GraphCodeUiaGateState\]::RevealSubmenuByKeyboard\(.*?Turn promotion submenu did not reopen by hover or keyboard' -or
$uiaLiveGateSource -match 'SendCommand\(\s*\$renameShellWindow, \[uint32\]\$case\.Command\)' -or
$uiaLiveGateSource -notmatch 'modalCommandFallback' -or
$uiaLiveGateSource -notmatch 'function Stop-UiaOwnedProviderProcesses' -or
Expand Down
33 changes: 24 additions & 9 deletions Tools/windows/uia-live-gate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10374,17 +10374,32 @@ try {
$reopen = Open-SketchNodeMenu $title
$parent = @($reopen.items | Where-Object { $_.Text -eq "Promote to..." -and $_.Enabled })
Require ($parent.Count -eq 1) "cancelled sketch promotion disappeared from menu"
$handle = [GraphCodeUiaGateState]::NativeSubMenu(
[GraphCodeUiaGateState]::PopupMenuHandle($reopen.popup), [int]$parent[0].Position)
Require ([GraphCodeUiaGateState]::HoverPopupMenuItem($renameShellWindow,
[GraphCodeUiaGateState]::PopupMenuHandle($reopen.popup), [int]$parent[0].Position)) `
"Turn promotion submenu did not reopen"
$reopenRoot = [GraphCodeUiaGateState]::PopupMenuHandle($reopen.popup)
$handle = [GraphCodeUiaGateState]::NativeSubMenu($reopenRoot, [int]$parent[0].Position)
$reopenKeyboardReveal = $false
$reopenHoverRevealed = [GraphCodeUiaGateState]::HoverPopupMenuItem($renameShellWindow,
$reopenRoot, [int]$parent[0].Position)
$subPopup = [IntPtr]::Zero
for ($retry = 0; $retry -lt 60 -and $subPopup -eq [IntPtr]::Zero; $retry++) {
$subPopup = [GraphCodeUiaGateState]::FindPopupForMenu([uint32]$renameProcess.Id, $handle)
if ($subPopup -eq [IntPtr]::Zero) { Start-Sleep -Milliseconds 50 }
if ($reopenHoverRevealed) {
for ($retry = 0; $retry -lt 60 -and $subPopup -eq [IntPtr]::Zero; $retry++) {
$subPopup = [GraphCodeUiaGateState]::FindPopupForMenu([uint32]$renameProcess.Id, $handle)
if ($subPopup -eq [IntPtr]::Zero) { Start-Sleep -Milliseconds 50 }
}
}
if ($subPopup -eq [IntPtr]::Zero) {
# Same keyboard reveal as the first open: injected hover is not delivered
# on every desktop, and a WM_COMMAND to the shell would be a no-op.
$reopenKeyboardReveal = [GraphCodeUiaGateState]::RevealSubmenuByKeyboard(
$reopen.popup, $reopenRoot, [int]$parent[0].Position)
Require $reopenKeyboardReveal `
"Turn promotion parent item could not be selected for keyboard submenu reveal"
for ($retry = 0; $retry -lt 60 -and $subPopup -eq [IntPtr]::Zero; $retry++) {
$subPopup = [GraphCodeUiaGateState]::FindPopupForMenu([uint32]$renameProcess.Id, $handle)
if ($subPopup -eq [IntPtr]::Zero) { Start-Sleep -Milliseconds 50 }
}
}
Require ($subPopup -ne [IntPtr]::Zero) "Turn promotion submenu did not reopen natively"
Write-Host "UIA_SKETCH_SUBMENU_REOPEN title='$title' hoverRevealed=$reopenHoverRevealed keyboardReveal=$reopenKeyboardReveal popup=$($subPopup -ne [IntPtr]::Zero)"
Require ($subPopup -ne [IntPtr]::Zero) "Turn promotion submenu did not reopen by hover or keyboard"
$null = Sketch-ClickMenu @{ popup = $subPopup; items = @(Get-NativeMenuItems $handle) } 5117
$modal = Assert-SketchModal "Promote $title to Turn"
$submitFields = @{ pause = Sketch-Combo 9100 1 "Only before it writes files" }
Expand Down
1 change: 1 addition & 0 deletions graphcode-workspace.159bee7166972fae.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"schemaVersion":2,"project":"C:\\v7\\9bd69edc5a444088ab28df14bae7d858\\temp\\gu-3105f799a95b493280820005d224ec6e\\project","selectedTab":1,"tabs":[{"id":1,"direction":"horizontal","focused":0,"panes":[{"id":"11111111-1111-4111-8111-111111111111","agent":true}]},{"id":2,"direction":"horizontal","focused":0,"panes":[{"id":"ed498986-ee0f-525f-ec6d-bbdab7bf0afc","agent":false}]}]}
Loading