-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
TSFInputControl alignment is slightly off on High DPI #5470
Comments
(just a thought, noting it down here) maybe the text box has a slight border thickness and where the ime shows up is actually at the beginning of the text box? Edit: for whatever reason, bringing emoji IME up on a new tab will overlap the row no matter what |
This PR fixes a couple of issues with TSFInputControl alignment: 1. The emoji picker IME in particular would show up overlapping the current buffer row because I stupidly didn't realize that `TextBlock.ActualHeight` is 0 right after initialization and before it has any text. So, the emoji picker will show up on the bottom of the 0 height TextBlock, which overlaps the current buffer row. This isn't a problem with CJK because inputting text _causes_ the IME to show up, so by the time the IME shows up, the TextBlock has text and accordingly has a height. 2. It turns out the emoji picker IME doesn't follow the `TextBlock` bottom, unlike Chinese and Japanese IME, so if a user were to compose near the edge of the screen and let the `TextBlock` start line wrapping, the emoji IME doesn't follow the bottom of the `TextBlock` as it grows. This means that the `TextBlock` position doesn't update in the middle of composition, and the `LayoutRequested` event that it fires at the beginning of composition is the only chance we get to tell the emoji IME where to place itself. It turns out when we reset `TextBlock.Text`, the ActualHeight doesn't get immediately reset back to the min size. So if a user were to bring up the emoji IME before `ActualHeight` is reset, the IME will show up way below the current buffer row. 3. We don't currently `TryRedrawCanvas` when the window position changes (resizing, dragging the window around), so sometimes dragging or resizing the Terminal doesn't update the position of the IME. Ideally it should be listening to some "window position changed" event, but alas we don't have that and it would be much harder than this incoming fix. We'll just track the window bounds as part of `TryRedrawCanvas` and redraw if it changes. For the most part, this will allow the IME to update to where the new window position is, but it'll only be called if we receive a `LayoutRequested` event. ## PR Checklist * [x] Closes #5470 * [x] CLA signed. * [x] Tests added/passed ## Validation Steps Performed I play with it for quite a bit.
🎉This issue was addressed in #5609, which has now been successfully released as Handy links: |
TSFInputControl
needs to account for scaling (migrie: ✔️)Originally posted by @miniksa in #5345 (comment)
The text was updated successfully, but these errors were encountered: