[PR #10650] [MERGED] Fix a pair of TermControl dragging bugs #28157

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10650
Author: @zadjii-msft
Created: 7/13/2021
Status: Merged
Merged: 7/28/2021
Merged by: @undefined

Base: mainHead: dev/migrie/b/9109-tab-drag-scrolling


📝 Commits (10+)

  • e4478ee Only access ControlInteractivity through the projection
  • 400b35f Only 24 more errors to go
  • 42b970b Totally upend the control AutomationPeer workings
  • 4578c13 some comments that should have been in the previous commit. 16 errors remain.
  • d8cc047 GetHoveredCell/UpdateHoveredCell. 12 remain.
  • 21a97b6 Revert "Revert "Use DComp surface handle for Swap Chain management.""
  • 2e861d8 some minor cleanup
  • e20caae Merge branch 'dev/migrie/f/oop/use-dcomp-handle' into dev/migrie/interactivity-projection-000
  • d667f3b Use the HANDLE for the swapchainin the core projection
  • 62cbf30 it builds and runs so I guess it's done now

📊 Changes

6 files changed (+116 additions, -15 deletions)

View changed files

📝 src/cascadia/TerminalControl/ControlInteractivity.cpp (+7 -2)
📝 src/cascadia/TerminalControl/ControlInteractivity.h (+2 -1)
📝 src/cascadia/TerminalControl/ControlInteractivity.idl (+3 -1)
📝 src/cascadia/TerminalControl/TermControl.cpp (+18 -3)
📝 src/cascadia/TerminalControl/TermControl.h (+3 -1)
📝 src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp (+83 -7)

📄 Description

Summary of the Pull Request

This fixes two bugs related to dragging into the bounds of the TermControl. Although the fixes are fairly small, I'm batching them up, because I don't want to stack 2 more PRs on top of #10051.

  • #9109
    • This is fixed by only starting an autoscroll if the click&drag actually started within the bounds of the control.
  • #4603
    • Building on the above change, only modify the selection when the drag started in the control.

References

PR Checklist

Detailed Description of the Pull Request / Additional comments

This is kind of annoying that the auto-scrolling is handled by the TermControl, but it uses a timer that's still a WinUI construct.

We only want to start the auto-scrolling behavior when the drag started inside the control. Otherwise, in the tab drag scenario, dragging into the bounds of the TermControl will trick it into thinking it should start a scroll.


🔄 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/10650 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 7/13/2021 **Status:** ✅ Merged **Merged:** 7/28/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/b/9109-tab-drag-scrolling` --- ### 📝 Commits (10+) - [`e4478ee`](https://github.com/microsoft/terminal/commit/e4478eec6afa26b0f9d401e80195b527471a1005) Only access ControlInteractivity through the projection - [`400b35f`](https://github.com/microsoft/terminal/commit/400b35f8140732aa8483f6a90c09ad225a93581c) Only 24 more errors to go - [`42b970b`](https://github.com/microsoft/terminal/commit/42b970b7f22248bb17dd295011ce6a5ff5a064cf) Totally upend the control AutomationPeer workings - [`4578c13`](https://github.com/microsoft/terminal/commit/4578c136a054a1efc50e99264a555547a909fda1) some comments that should have been in the previous commit. 16 errors remain. - [`d8cc047`](https://github.com/microsoft/terminal/commit/d8cc047a7ef39d93430bc724e8071e3568cd4dc6) GetHoveredCell/UpdateHoveredCell. 12 remain. - [`21a97b6`](https://github.com/microsoft/terminal/commit/21a97b6c80dd95cf3be84d9eb2070adc5956fa75) Revert "Revert "Use DComp surface handle for Swap Chain management."" - [`2e861d8`](https://github.com/microsoft/terminal/commit/2e861d8a37886278e638c556b71e44943d6b64b7) some minor cleanup - [`e20caae`](https://github.com/microsoft/terminal/commit/e20caae758319433196b4baa4cf6a06354801e05) Merge branch 'dev/migrie/f/oop/use-dcomp-handle' into dev/migrie/interactivity-projection-000 - [`d667f3b`](https://github.com/microsoft/terminal/commit/d667f3b63340b6db35a30e141c75bdecb6931ad0) Use the HANDLE for the swapchainin the core projection - [`62cbf30`](https://github.com/microsoft/terminal/commit/62cbf30782fd8439d755226c43ed7d366748aa94) it builds and runs so I guess it's done now ### 📊 Changes **6 files changed** (+116 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/ControlInteractivity.cpp` (+7 -2) 📝 `src/cascadia/TerminalControl/ControlInteractivity.h` (+2 -1) 📝 `src/cascadia/TerminalControl/ControlInteractivity.idl` (+3 -1) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+18 -3) 📝 `src/cascadia/TerminalControl/TermControl.h` (+3 -1) 📝 `src/cascadia/UnitTests_Control/ControlInteractivityTests.cpp` (+83 -7) </details> ### 📄 Description ## Summary of the Pull Request This fixes two bugs related to dragging into the bounds of the `TermControl`. Although the fixes are fairly small, I'm batching them up, because I don't want to stack 2 more PRs on top of #10051. * #9109 - This is fixed by only starting an autoscroll if the click&drag actually started within the bounds of the control. * #4603 - Building on the above change, only modify the selection when the drag started in the control. ## References * srsly go read #10051. ## PR Checklist * [x] Closes #9109 * [x] Closes #4603 * [x] I work here * [x] Test added * [n/a] Requires documentation to be updated ## Detailed Description of the Pull Request / Additional comments This is kind of annoying that the auto-scrolling is handled by the TermControl, but it uses a timer that's still a WinUI construct. We only want to start the auto-scrolling behavior when the drag started _inside_ the control. Otherwise, in the tab drag scenario, dragging into the bounds of the TermControl will trick it into thinking it should start a scroll. --- <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:26:42 +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#28157