Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -3137,10 +3137,8 @@ internal bool Enabled
}

/////////////////////////////////////////////////////////////////////
internal void RegisterHwndForInput(InputManager inputManager, PresentationSource inputSource)
internal void RegisterHwndForInput(InputManager inputManager, HwndSource hwndSource)
{
HwndSource hwndSource = (HwndSource)inputSource;

GetAndCacheTransformToDeviceMatrix(hwndSource);

// Keep track so we don't bother looking for changes if someone happened to query this before
Expand All @@ -3152,14 +3150,14 @@ internal void RegisterHwndForInput(InputManager inputManager, PresentationSource

lock (__penContextsLock)
{
if (__penContextsMap.ContainsKey(inputSource))
if (__penContextsMap.ContainsKey(hwndSource))
{
throw new InvalidOperationException(SR.PenService_WindowAlreadyRegistered);
}

PenContexts penContexts = new PenContexts(StylusLogic.GetCurrentStylusLogicAs<WispLogic>(), inputSource);
PenContexts penContexts = new PenContexts(StylusLogic.GetCurrentStylusLogicAs<WispLogic>(), hwndSource);

__penContextsMap[inputSource] = penContexts;
__penContextsMap[hwndSource] = penContexts;

// If FIRST one set this as the one to manage TabletAdded/Removed notifications.
if (__penContextsMap.Count == 1)
Expand Down