[PR #5427] Various Differential Drawing fixes for #5345 #26321

Open
opened 2026-01-31 09:15:20 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/5427

State: closed
Merged: Yes


Summary of the Pull Request

This is everything I've found in my attempt to resurrect #5345.

There are a bunch of new bugs and edge cases I've added to https://github.com/microsoft/terminal/pull/5345#issuecomment-614127648. Largely, things are much better.

TermControl.cpp

  • Use the font size in DIPs for pointer movement events, mouse scrolling events
  • When the settings are reloaded, if we change the font size, resize the buffer to fit the current window.
  • Actually whenever the font size changes, make sure to refresh the size of the buffer for the new font size in this window.
  • Use the engine's curent scale when dealing with a swapchain size change to avoid a bug where only part of the biewport would get redrawn
    • (this might actually not be needed anymore)
  • When the DPI changes, guess what, the font size might change too. Resize the buffer if it did.
  • When we're trying to get the pointer position inside the terminal, use til to make our lives easier.

TSFInputControl.cpp

  • Use til in this method to make our life easier
  • Properly account for things that are in DIPs and things that aren't anymore.

ScreenInfo.cpp

  • Make sure to update the size of the viewport with the VtEngine as soon as a resize happens, otherwise the rest of the invalidates that happen in this frame are going to error out and cause tearing.

point.h

  • add a point(float, float) ctor.

rectangle.h

  • add a winrt Rect cast.

size.h

  • add a size(int, ptrdiff_t) ctor.
  • add a size(ptrdiff_t, int) ctor.
  • add a size(float, float) ctor.

DxRenderer.cpp

  • When we incalidate all, just mark this as a _firstFrame, and don't bother with Present1. We know it won't work. So don't.
  • Don't use _invalidMap.all() in PaintBackground, because it mostly won't work.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/5427 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request This is everything I've found in my attempt to resurrect #5345. There are a bunch of new bugs and edge cases I've added to https://github.com/microsoft/terminal/pull/5345#issuecomment-614127648. Largely, things are much better. ### `TermControl.cpp` * Use the font size in DIPs for pointer movement events, mouse scrolling events * When the settings are reloaded, if we change the font size, resize the buffer to fit the current window. * Actually whenever the font size changes, make sure to refresh the size of the buffer for the new font size in this window. * Use the engine's curent scale when dealing with a swapchain size change to avoid a bug where only part of the biewport would get redrawn - (this might actually not be needed anymore) * When the DPI changes, guess what, the font size might change too. Resize the buffer if it did. * When we're trying to get the pointer position inside the terminal, use `til` to make our lives easier. ### `TSFInputControl.cpp` * Use `til` in this method to make our life easier * Properly account for things that are in DIPs and things that aren't anymore. ### `ScreenInfo.cpp` * Make sure to update the size of the viewport with the VtEngine as soon as a resize happens, otherwise the rest of the invalidates that happen in this frame are going to error out and cause tearing. ### `point.h` * add a `point(float, float)` ctor. ### `rectangle.h` * add a winrt `Rect` cast. ### `size.h` * add a `size(int, ptrdiff_t)` ctor. * add a `size(ptrdiff_t, int)` ctor. * add a `size(float, float)` ctor. ### `DxRenderer.cpp` * When we incalidate all, just mark this as a `_firstFrame`, and don't bother with `Present1`. We know it won't work. So don't. * Don't use `_invalidMap.all()` in `PaintBackground`, because it mostly won't work.
claunia added the pull-request label 2026-01-31 09:15:20 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26321