[PR #11902] [MERGED] Prepare til wrappers for migrating off of SMALL_RECT #28798

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11902
Author: @lhecker
Created: 12/8/2021
Status: Merged
Merged: 1/13/2022
Merged by: @undefined

Base: mainHead: dev/lhecker/issue-4015-prepare


📝 Commits (5)

  • 21e912d Prepare til wrappers for migrating off of SMALL_RECT
  • 1bf8011 Address feedback
  • 4a5587a Merge remote-tracking branch 'origin/main' into dev/lhecker/issue-4015-prepare
  • 9037412 Address feedback, Fix annoyances
  • 47fc9a4 Merge remote-tracking branch 'origin/main' into dev/lhecker/issue-4015-prepare

📊 Changes

81 files changed (+2695 additions, -3642 deletions)

View changed files

📝 src/buffer/out/textBuffer.cpp (+29 -29)
📝 src/cascadia/PublicTerminalCore/HwndTerminal.cpp (+17 -11)
📝 src/cascadia/TerminalControl/ControlCore.cpp (+16 -19)
📝 src/cascadia/TerminalControl/ControlCore.h (+2 -2)
📝 src/cascadia/TerminalControl/ControlInteractivity.cpp (+36 -34)
📝 src/cascadia/TerminalControl/ControlInteractivity.h (+14 -14)
📝 src/cascadia/TerminalControl/InteractivityAutomationPeer.cpp (+5 -5)
📝 src/cascadia/TerminalControl/InteractivityAutomationPeer.h (+2 -2)
📝 src/cascadia/TerminalControl/TSFInputControl.cpp (+16 -16)
📝 src/cascadia/TerminalControl/TermControl.cpp (+25 -20)
📝 src/cascadia/TerminalCore/Terminal.cpp (+9 -9)
📝 src/cascadia/TerminalCore/TerminalSelection.cpp (+2 -2)
📝 src/cascadia/TerminalCore/terminalrenderdata.cpp (+1 -1)
📝 src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp (+37 -37)
📝 src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp (+124 -125)
📝 src/cascadia/WinRTUtils/inc/Utils.h (+0 -17)
📝 src/cascadia/WindowsTerminal/AppHost.cpp (+18 -18)
📝 src/cascadia/WindowsTerminal/IslandWindow.cpp (+41 -46)
📝 src/cascadia/WindowsTerminal/IslandWindow.h (+1 -1)
📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp (+17 -17)

...and 61 more files

📄 Description

This commit makes the following changes to til::point/size/rectangle
for the following reasons:

  • Rename rectangle into rect
    This will make the naming consistent with a later small_rect struct
    as well as the existing Win32 POINT/SIZE/RECT structs.
  • Standardizes til wrappers on int32_t instead of ptrdiff_t
    Provides a consistent behavior between x86 and x64, preventing accidental
    errors on x86, as it's less rigorously tested than x64. Additionally it
    improves interop with MIDL3 which only supports fixed width integer types.
  • Standardizes til wrappers on throwing gsl::narrow_error
    Makes the behavior of our code more consistent.
  • Makes all eligible functions constexpr
    Because why not.
  • Removes implicit constructors and conversion operators
    This is a complex and controversial topic. My reasons are: You can't Ctrl+F
    for an implicit conversion. This breaks most non-IDE engines, like the one on
    GitHub or those we have internally at MS. This is important for me as these
    implicit conversion operators aren't cost free. Narrowing integers itself,
    as well as the boundary checks that need to be done have a certain,
    fixed overhead each time. Additionally the lack of noexcept prevents
    many advanced compiler optimizations. Removing their use entirely
    drops conhost's code segment size by around ~6.5%.

References

Preliminary work for #4015.

PR Checklist

  • I work here
  • Tests added/passed

Validation Steps Performed

I'm mostly relying on our unit tests here. Both OpenConsole and WT appear to work fine.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11902 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 12/8/2021 **Status:** ✅ Merged **Merged:** 1/13/2022 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/lhecker/issue-4015-prepare` --- ### 📝 Commits (5) - [`21e912d`](https://github.com/microsoft/terminal/commit/21e912d0173075f36b021ddf8c50668d2c8fcd1e) Prepare til wrappers for migrating off of SMALL_RECT - [`1bf8011`](https://github.com/microsoft/terminal/commit/1bf8011fc03a2eb368d743a31ae07e4cddecdc67) Address feedback - [`4a5587a`](https://github.com/microsoft/terminal/commit/4a5587afc9c115bb764cd832c0d8226b9517789f) Merge remote-tracking branch 'origin/main' into dev/lhecker/issue-4015-prepare - [`9037412`](https://github.com/microsoft/terminal/commit/9037412dc0aa5c1c4c611f62ac414403bcdd0e3b) Address feedback, Fix annoyances - [`47fc9a4`](https://github.com/microsoft/terminal/commit/47fc9a42a1d692b71e4c2b01c15b337526078cba) Merge remote-tracking branch 'origin/main' into dev/lhecker/issue-4015-prepare ### 📊 Changes **81 files changed** (+2695 additions, -3642 deletions) <details> <summary>View changed files</summary> 📝 `src/buffer/out/textBuffer.cpp` (+29 -29) 📝 `src/cascadia/PublicTerminalCore/HwndTerminal.cpp` (+17 -11) 📝 `src/cascadia/TerminalControl/ControlCore.cpp` (+16 -19) 📝 `src/cascadia/TerminalControl/ControlCore.h` (+2 -2) 📝 `src/cascadia/TerminalControl/ControlInteractivity.cpp` (+36 -34) 📝 `src/cascadia/TerminalControl/ControlInteractivity.h` (+14 -14) 📝 `src/cascadia/TerminalControl/InteractivityAutomationPeer.cpp` (+5 -5) 📝 `src/cascadia/TerminalControl/InteractivityAutomationPeer.h` (+2 -2) 📝 `src/cascadia/TerminalControl/TSFInputControl.cpp` (+16 -16) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+25 -20) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+9 -9) 📝 `src/cascadia/TerminalCore/TerminalSelection.cpp` (+2 -2) 📝 `src/cascadia/TerminalCore/terminalrenderdata.cpp` (+1 -1) 📝 `src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp` (+37 -37) 📝 `src/cascadia/UnitTests_TerminalCore/ConptyRoundtripTests.cpp` (+124 -125) 📝 `src/cascadia/WinRTUtils/inc/Utils.h` (+0 -17) 📝 `src/cascadia/WindowsTerminal/AppHost.cpp` (+18 -18) 📝 `src/cascadia/WindowsTerminal/IslandWindow.cpp` (+41 -46) 📝 `src/cascadia/WindowsTerminal/IslandWindow.h` (+1 -1) 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp` (+17 -17) _...and 61 more files_ </details> ### 📄 Description This commit makes the following changes to `til::point/size/rectangle` for the following reasons: * Rename `rectangle` into `rect` This will make the naming consistent with a later `small_rect` struct as well as the existing Win32 POINT/SIZE/RECT structs. * Standardizes til wrappers on `int32_t` instead of `ptrdiff_t` Provides a consistent behavior between x86 and x64, preventing accidental errors on x86, as it's less rigorously tested than x64. Additionally it improves interop with MIDL3 which only supports fixed width integer types. * Standardizes til wrappers on throwing `gsl::narrow_error` Makes the behavior of our code more consistent. * Makes all eligible functions `constexpr` Because why not. * Removes implicit constructors and conversion operators This is a complex and controversial topic. My reasons are: You can't Ctrl+F for an implicit conversion. This breaks most non-IDE engines, like the one on GitHub or those we have internally at MS. This is important for me as these implicit conversion operators aren't cost free. Narrowing integers itself, as well as the boundary checks that need to be done have a certain, fixed overhead each time. Additionally the lack of noexcept prevents many advanced compiler optimizations. Removing their use entirely drops conhost's code segment size by around ~6.5%. ## References Preliminary work for #4015. ## PR Checklist * [x] I work here * [x] Tests added/passed ## Validation Steps Performed I'm mostly relying on our unit tests here. Both OpenConsole and WT appear to work fine. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:30:49 +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#28798