Repository navigation
Open
Labels
Description
Operating system
Windows
Orca version
1.4.176
Details
Short summary:
Constantly activating hidden RemoteApp or Remote Desktop window that take over the active app focus.
How to reproduce it:
- Open Orca.
- Maybe you need to pair a mobile device.
- Run powershell script
- See active window changes.
Script:
Add-Type -AssemblyName System.Windows.Forms
$Code = @"
using System;
using System.Runtime.InteropServices;
using System.Text;
public class WindowTracker {
public delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime);
[DllImport("user32.dll")]
public static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags);
[DllImport("user32.dll")]
public static extern bool UnhookWinEvent(IntPtr hWinEventHook);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
[DllImport("user32.dll", SetLastError = true)]
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
public const uint EVENT_SYSTEM_FOREGROUND = 0x0003;
public const uint WINEVENT_OUTOFCONTEXT = 0x0000;
}
"@
Add-Type -TypeDefinition $Code
# Store in $script scope to prevent Garbage Collection
$script:delegate = [WindowTracker+WinEventDelegate]{
param($hWinEventHook, $eventType, $hwnd, $idObject, $idChild, $dwEventThread, $dwmsEventTime)
if ($hwnd -ne [IntPtr]::Zero) {
$titleBuilder = New-Object System.Text.StringBuilder 256
[void][WindowTracker]::GetWindowText($hwnd, $titleBuilder, $titleBuilder.Capacity)
$pidOut = 0
[void][WindowTracker]::GetWindowThreadProcessId($hwnd, [ref]$pidOut)
$pName = try { (Get-Process -Id $pidOut -ErrorAction SilentlyContinue).ProcessName } catch { "Unknown" }
$title = $titleBuilder.ToString()
if ([string]::IsNullOrWhiteSpace($title)) { $title = "<No Title>" }
Write-Host ("[{0}] PID: {1} ({2}) | Title: {3}" -f (Get-Date -Format "HH:mm:ss.fff"), $pidOut, $pName, $title)
}
}
# Register Hook
$hook = [WindowTracker]::SetWinEventHook(
[WindowTracker]::EVENT_SYSTEM_FOREGROUND,
[WindowTracker]::EVENT_SYSTEM_FOREGROUND,
[IntPtr]::Zero,
$script:delegate,
0, 0,
[WindowTracker]::WINEVENT_OUTOFCONTEXT
)
if ($hook -eq [IntPtr]::Zero) {
Write-Error "Failed to set WinEvent hook."
return
}
Write-Host "Hook active and message loop running. Press Ctrl+C to stop..." -ForegroundColor Green
# Run message loop to process hook callbacks
try {
[System.Windows.Forms.Application]::Run()
} finally {
# Unhook on exit (Ctrl+C)
[void][WindowTracker]::UnhookWinEvent($hook)
Write-Host "`nHook successfully removed." -ForegroundColor Yellow
}
Here is what I get:
[21:14:18.395] PID: 28876 (Orca) | Title: Orca
[21:15:07.882] PID: 31208 (msrdc) | Title: Remote Desktop
[21:15:29.807] PID: 28876 (Orca) | Title: Orca
[21:17:08.881] PID: 49860 (msrdc) | Title: Remote Desktop
[21:17:30.062] PID: 28876 (Orca) | Title: Orca
Activity
AmethystLiang commentedon Aug 8, 2026
thanks for reporting. looking into it
monkeylight commentedon Aug 11, 2026
I can reproduce this on the current stable release and captured a conclusive foreground-window/process trace.
Environment
Symptoms
While Orca is running, keyboard focus is lost system-wide. This affects browser inputs, WeChat, and Orca itself. The desktop/taskbar also appears to refresh. Closing Orca stops the behavior.
The interval is not assumed to be exactly one minute, but two consecutive captured occurrences were about 61 seconds apart.
Foreground-window trace
Each focus-loss event was a newly created
msrdc.exeprocess, not a persistent Remote Desktop window.Elevated process-start trace
A second trace captured the process chain:
Example:
The WSL distribution is normally stopped between occurrences.
Orca configuration
This machine is not configured to use WSL as the Orca runtime:
terminalWindowsWslDistro: nullwindows-hostregisteredDistros: empty.wslconfigfile was presentThis suggests that a periodic Orca background capability/account/filesystem probe may be starting WSL even though no WSL runtime is selected. WSLg then creates a fresh MSRDC window which receives foreground activation. This is an inference from the process/focus correlation; the initiating WSL/UNC call was too short-lived to capture directly.
This is distinct from #7703 / #8053: in this reproduction the foreground owner is conclusively
msrdc.exe, notconhost.exefrom an unhidden PowerShell/WMIC probe.A useful fix would be to avoid starting WSL/WSLg for background probes when the selected runtime is Windows host, or ensure that any such probe cannot activate the WSLg Remote Desktop window.
misakieku commentedon Aug 14, 2026
I can solve this temporarily by disabling wslg (gui application support) in wsl. I'm not sure if this is an issue with orca or wslg.
Asjan commentedon Sep 30, 2026
Same problem. Disabling wslg helped me.
FORyc commentedon Oct 10, 2026
Confirming this on the current release, with the missing half of the chain: the WSL probe that starts the distro is Orca's own WSL CLI registration/inspection, and it runs for distros that are neither registered nor selected as a runtime.
Environment
podman-net-usermode(default),podman-machine-defaultterminalWindowsWslDistro: null,localAccountWslDistro: null,wsl-cli-registrations.jsonregisteredDistros: [], no WSL project or worktree1. The foreground owner is a freshly spawned
msrdc.exe(as @monkeylight found)Full process chain, captured with a 80 ms
Win32_Processpoll onmsrdc.exe:C:\Program Files\WSL\wslg.rdpisremoteapplicationmode:i:1+remoteapplicationprogram:s:dummy-entry, i.e. the WSLg RemoteApp host. The window that takes the foreground is invisible, classTscShellContainerClass, title远程桌面(Remote Desktop) /RemoteApp.2. Foreground steals, correlated with the Orca process lifetime
WinEvent hook (
EVENT_SYSTEM_FOREGROUND) +GetLastInputInfo, so each entry is tagged "user input" vs "programmatic". In one session,msrdc.exetook the foreground 21 times; 13 of them with no user input for 0.4 s – 12.8 s:Orca was restarted at
09:28:56; the firstmsrdcsteal is09:29:00and the burst ends at09:34:26. During a burst the period is ~21 s and every occurrence is a brand-new PID (from09:40:12to09:45:23: 16 consecutive newmsrdc.exeprocesses, one every 20–21 s), matching "not a persistent Remote Desktop window".3. New evidence: Orca's WSL inspection starts the distro even with no WSL runtime selected
%APPDATA%\orca\wsl-cli-registrations.jsonon this machine:{ "schemaVersion": 2, "registeredDistros": [], "inspectionTimes": { "podman-net-usermode": 1791595746388, "podman-machine-default": 1790563855318 }, "reconciliations": {} }1791595746388= 2026-10-10 09:29:06 local — the same second range in which themsrdcburst started (Orca process start: 09:28:56).1790563855318= 2026-09-28 10:50. So Orca wrote an inspection timestamp for a distro that is not inregisteredDistrosand is not used by any project.In
app.asar(1.4.223) the inspection set is computed from an enumerated distro list, not from the registered ones:registeredDistrosonly feedsreconciliations; every enumerated distro is probed on a 7-day negative TTL. That is the step that starts the WSL VM, and WSLg then materialises a newmsrdc.exeRemoteApp host per attempt — each one activating its invisibleTscShellContainerClasswindow. This also explains the reporter's observation that the behaviour appears even though the distro is normally stopped.4. Minimal reproduction
With WSLg enabled (no
.wslconfig, orguiApplicationsunset/true):Result:
msrdc.exe /wslg ...appears ~2.2 s later, and then keeps being recreated every ~21 s for as long as the VM lives. Every creation steals the foreground from whatever the user is typing in.5. A/B:
[wsl2] guiApplications=falseremoves it completelywsl.exe -d podman-net-usermode -- truemsrdc.execreatedwslhost.exe(VM started)After adding to
%USERPROFILE%\.wslconfig:followed by
wsl --shutdown. Note that the VM/wslhost.exestill starts, the distro still runs commands,podman 5.3.0andpodman.socketare unaffected — only the WSLg RemoteApp host is gone. This matches @misakieku and @Asjan above; the same workaround is suggested in microsoft/wslg#894 / #895 / #1135 and microsoft/WSL#41418, which are the samemsrdc.exefocus theft at the WSL side.6. Requested fix
wsl.exe --list --quiet) does not start the VM; only the in-distro CLI probe does. Gate the probe behind "a WSL distro is actually selected as runtime / registered", make it opt-in, or defer it until that distro is first used.guiApplications=falseworkaround in troubleshooting docs/FAQ until this is fixed.msrdc.exe(WSLg), neverconhost.exe.fix(wsl): drop project-demand scoping; keep only harmless WSL probe s…
fix(wsl): skip unused background wsl.exe status reads (Claude publish…