-
Notifications
You must be signed in to change notification settings - Fork 8.7k
wpf: use the new TSF implementation #18861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This fixes two issues in the WPF terminal control: - The emoji picker and other IME candidate windows didn't show up in the right place - Submitting an emoji via the emoji picker would result in two win32 input mode events with a VK of 65535 and the surrogate pair halves. I am not sure I did the right thing with the thread TSF handle...
fontSize = _terminal->_actualFont.GetSize(); | ||
} | ||
POINT ptSuggestion = { | ||
.x = cursorPos.x * fontSize.width, | ||
.y = cursorPos.y * fontSize.height, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _actualFont.GetSize()
is in pixel?
Microsoft::Console::TSF::Handle _tsfHandle; | ||
TsfDataProvider _tsfDataProvider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The destruction order is wrong here. You need to destroy the Handle
first, since the TsfDataProvider
doesn't properly implement AddRef
/Release
. I think this is worth commenting as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Dustin showed me that Teardown
does it in the right order.)
@@ -171,7 +243,8 @@ HwndTerminal::HwndTerminal(HWND parentHwnd) noexcept : | |||
_uiaProvider{ nullptr }, | |||
_currentDpi{ USER_DEFAULT_SCREEN_DPI }, | |||
_pfnWriteCallback{ nullptr }, | |||
_multiClickTime{ 500 } // this will be overwritten by the windows system double-click time | |||
_multiClickTime{ 500 }, // this will be overwritten by the windows system double-click time | |||
_tsfDataProvider{ this } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I believe you can also use { this }
in the header.
@@ -242,6 +315,11 @@ try | |||
{ | |||
// As a rule, detach resources from the Terminal before shutting them down. | |||
// This ensures that teardown is reentrant. | |||
if (_tsfHandle) | |||
{ | |||
_tsfHandle.Unfocus(&_tsfDataProvider); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you don't need to unfocus during teardown. Re-reading its implementation shows that it is primarily concerned with clearing the pending compositions out of the renderer.
This fixes two issues in the WPF terminal control: - The emoji picker and other IME candidate windows didn't show up in the right place - Submitting an emoji via the emoji picker would result in two win32 input mode events with a VK of 65535 and the surrogate pair halves. I am not sure I did the right thing with the thread TSF handle... (cherry picked from commit 06f736b) Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgZ-Sw0 Service-Version: 1.23
This fixes two issues in the WPF terminal control: - The emoji picker and other IME candidate windows didn't show up in the right place - Submitting an emoji via the emoji picker would result in two win32 input mode events with a VK of 65535 and the surrogate pair halves. I am not sure I did the right thing with the thread TSF handle... (cherry picked from commit 06f736b) Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgZ-Sw4 Service-Version: 1.22
This fixes two issues in the WPF terminal control:
I am not sure I did the right thing with the thread TSF handle...