Skip to content

WISP touch: contacts on child or unregistered HwndSources are not orphaned when input to them stops, blocking touch in other windows #12179

Backlog

Description

@amarinov-msft

Description

#11999 orphans active touch contacts when their window is disabled, for example by ShowDialog. This stops an unfinished contact from staying primary and blocking touch input in the dialog (#194). Orphaning is triggered only by WM_ENABLE on the HwndSource that receives it (WispLogic.OnWindowEnableChanged => OrphanTouchDevices). Two cases are not covered:

  1. Child HwndSources (e.g. WPF content hosted inside an HwndHost child window). Windows does not send WM_ENABLE to child windows when their top-level window is disabled. As a result, neither PenContexts.IsWindowDisabled nor orphaning applies to them.
  2. Unregistered sources. WispLogic.UnRegisterHwndForInput disables the source's pen contexts but doesn't orphan or deactivate contacts that are active on that source.

In both cases the contact stays active and primary until its up arrives, if it arrives at all. Touches in other windows are not primary, so they don't promote to mouse.

Reproduction Steps

Use the default WISP stylus stack (Switch.System.Windows.Input.Stylus.EnablePointerSupport not set) on a touch-capable device.

Child HwndSource:

  1. Create a Window containing an HwndHost that creates a child HWND.
  2. Inside that child HWND, create an HwndSource (ParentWindow = the child HWND) whose RootVisual is a Button.
  3. In the hosted button's PreviewTouchDown (or StylusDown) handler, call new Window { Owner = mainWindow, Content = new Button { Content = "OK" } }.ShowDialog().
  4. Touch and hold the hosted button. While still holding, tap OK in the dialog with a second finger.

Unregistered source:

  1. Open a secondary Window, and in its PreviewTouchDown handler call Close().
  2. Touch and hold inside the secondary window so that it closes.
  3. While still holding, tap a Button in the main window.

Expected behavior

The tapped button raises Click, the same as when the held contact is on a top-level window disabled by the dialog.

Actual behavior

The held contact stays active and primary, so the second tap is not promoted to mouse and Click is not raised until the first finger lifts. For the closed window, it may stay stuck if the up is never delivered.

Regression?

No. This predates #11999, which fixes the top-level window case. It likely applies to .NET Framework as well.

Known Workarounds

Lift the held finger before interacting with the other window. Alternatively, enable the pointer stack.

Impact

.NET 11 (main), Windows 10/11 with touch, x64. Affects the WISP stack only.

Configuration

No response

Other information

• Raised in review of #11999 (comment 4743651822).
• Possible approach:
• When a source is disabled, also apply IsWindowDisabled and orphaning to descendant HwndSources (IsChild).
• Orphan or deactivate contacts active on a source in UnRegisterHwndForInput.
• Any orphaning must run after per-source cleanup that depends on the prior mouse button state (see #12034's CancelCompletedTouchPromotionsForSource).

Activity

  1. added
    Bug
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugarea-Touch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions