[PR #4506] [MERGED] Fix click-drag selection on an unfocused Terminal #25795

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/4506
Author: @leonMSFT
Created: 2/7/2020
Status: Merged
Merged: 2/13/2020
Merged by: @undefined

Base: masterHead: dev/lelian/clickdraginconsistencies


📝 Commits (8)

  • 0637374 inconsistencies seem to be consistent
  • 85cc071 removing a debugging code oops
  • 6907396 making the focus setting more local
  • ae33440 simplifying
  • 55593c6 adding comments and making things a little cleaner
  • 62a389c resolving merge conflicts
  • 79b5574 maybe this will make it look normal
  • 7fca63e fixing merge conflicts???

📊 Changes

2 files changed (+34 additions, -9 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+33 -9)
📝 src/cascadia/TerminalControl/TermControl.h (+1 -0)

📄 Description

Summary of the Pull Request

This PR tries to address some of the weird interactions with pointer pressed events when the Terminal isn't in focus. Here's the four things that have changed as part of this PR;

  1. This PR will allow the user to be able to make a selection with a click-drag without having to first perform a single click on a tab/pane to bring it to focus.
  2. Another weird bug that's fixed in this PR is where trying to make a selection on an unfocused tab when it already has a selection active will simply extend the existing selection instead of making a new one.
  3. Not related to the issue that his PR closes: a right click will now focus the tab/pane.

I've made sure that we still have the existing functionality where a single click on an unfocused tab/pane does not make a single-cell selection and just focuses the tab/pane.

PR Checklist

Validation Steps Performed

Played around with all sorts of selection when in-focus and out of focus with multiple panes and tabs.
Unit tests still pass as well.


🔄 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/4506 **Author:** [@leonMSFT](https://github.com/leonMSFT) **Created:** 2/7/2020 **Status:** ✅ Merged **Merged:** 2/13/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/lelian/clickdraginconsistencies` --- ### 📝 Commits (8) - [`0637374`](https://github.com/microsoft/terminal/commit/06373748d910d374c9a3249ee523185c073b86b0) inconsistencies seem to be consistent - [`85cc071`](https://github.com/microsoft/terminal/commit/85cc0710aeaf8373110ec0f58e3b9fa1d4fdd105) removing a debugging code oops - [`6907396`](https://github.com/microsoft/terminal/commit/6907396fbed2bb914b4db5e82374d285464f6969) making the focus setting more local - [`ae33440`](https://github.com/microsoft/terminal/commit/ae33440721a1b1d55fddadba1c5928b2da715393) simplifying - [`55593c6`](https://github.com/microsoft/terminal/commit/55593c6e8a290148d927e16f169b8fa0ccfd7d41) adding comments and making things a little cleaner - [`62a389c`](https://github.com/microsoft/terminal/commit/62a389c57897b3870a7221ca37b6598c2782d1fc) resolving merge conflicts - [`79b5574`](https://github.com/microsoft/terminal/commit/79b5574183c767e787d976b8b1eaab487f260115) maybe this will make it look normal - [`7fca63e`](https://github.com/microsoft/terminal/commit/7fca63e7e30ec21ee5fb14246af6f13548bdfba7) fixing merge conflicts??? ### 📊 Changes **2 files changed** (+34 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+33 -9) 📝 `src/cascadia/TerminalControl/TermControl.h` (+1 -0) </details> ### 📄 Description ## Summary of the Pull Request This PR tries to address some of the weird interactions with pointer pressed events when the Terminal isn't in focus. Here's the four things that have changed as part of this PR; 1. This PR will allow the user to be able to make a selection with a click-drag without having to first perform a single click on a tab/pane to bring it to focus. 2. Another weird bug that's fixed in this PR is where trying to make a selection on an unfocused tab when it already has a selection active will simply extend the existing selection instead of making a new one. 3. Not related to the issue that his PR closes: a right click will now focus the tab/pane. I've made sure that we still have the existing functionality where a single click on an unfocused tab/pane does not make a single-cell selection and just focuses the tab/pane. ## PR Checklist * [x] Closes #4282 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed ## Validation Steps Performed Played around with all sorts of selection when in-focus and out of focus with multiple panes and tabs. Unit tests still pass as well. --- <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:11:50 +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#25795