[PR #6343] [MERGED] Allow starting selections from padding area #26651

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/6343
Author: @carlos-zamora
Created: 6/4/2020
Status: Merged
Merged: 7/8/2020
Merged by: @undefined

Base: masterHead: dev/cazamor/sln/padding-sln


📝 Commits (2)

  • 5ec62b8 Allow starting selections from padding area
  • 0b2564d unname Grid

📊 Changes

2 files changed (+11 additions, -8 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+3 -3)
📝 src/cascadia/TerminalControl/TermControl.xaml (+8 -5)

📄 Description

WinUI's Margin and Padding work very similarly. Margin distances
ourselves from our parent. Whereas Padding distances our children from
ourselves.

Terminal's padding setting is actually implemented by defining
Margin on the SwapChainPanel. This means that the "padding" that is
created is actually belongs to SwapChainPanel's parent: Grid (not to be
confused with its parent, "RootGrid").

When a user clicks on the padded area, input goes to Grid. But there's a
twist: you can't actually hit Grid. To be able to hit Grid, you can't
just set IsHitTestVisible. You need to set it's Visibility to Visible,
and it's Background to Transparent (not null) [2].

Validation Steps Performed

  • Start a selection from the padding area
  • Click on a SearchBox if one is available
    • The SearchBox gets first dibs on the hit test so none gets through
      to the SwapChainPanel

References

[1] https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.uielement.ishittestvisible
[2] https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/events-and-routed-events-overview#hit-testing-and-input-events

Closes #5626


🔄 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/6343 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 6/4/2020 **Status:** ✅ Merged **Merged:** 7/8/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/cazamor/sln/padding-sln` --- ### 📝 Commits (2) - [`5ec62b8`](https://github.com/microsoft/terminal/commit/5ec62b8d28d252465096847b5bb15fc8fe6fa098) Allow starting selections from padding area - [`0b2564d`](https://github.com/microsoft/terminal/commit/0b2564dbce044c9f4c877b879f0e45fea13567aa) unname Grid ### 📊 Changes **2 files changed** (+11 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+3 -3) 📝 `src/cascadia/TerminalControl/TermControl.xaml` (+8 -5) </details> ### 📄 Description WinUI's `Margin` and `Padding` work very similarly. `Margin` distances ourselves from our parent. Whereas `Padding` distances our children from ourselves. Terminal's `padding` setting is actually implemented by defining `Margin` on the SwapChainPanel. This means that the "padding" that is created is actually belongs to SwapChainPanel's parent: Grid (not to be confused with its parent, "RootGrid"). When a user clicks on the padded area, input goes to Grid. But there's a twist: you can't actually hit Grid. To be able to hit Grid, you can't just set IsHitTestVisible. You need to set it's Visibility to Visible, and it's Background to Transparent (not null) [2]. ## Validation Steps Performed - [X] Start a selection from the padding area - [X] Click on a SearchBox if one is available - The SearchBox gets first dibs on the hit test so none gets through to the SwapChainPanel ## References [1] https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.uielement.ishittestvisible [2] https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/events-and-routed-events-overview#hit-testing-and-input-events Closes #5626 --- <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:17:21 +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#26651