Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging a tab makes the window slowly scroll up for a while even after not dragging the tab anymore #9109

Closed
RuurdBijlsma opened this issue Feb 11, 2021 · 4 comments · Fixed by #10650
Assignees
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@RuurdBijlsma
Copy link

Environment

Windows build number: 10.0.19042.0
Windows Terminal version (if applicable): 1.5.10271.0

Steps to reproduce

  1. Have a single tab open
  2. Drag that tab downward a little (starting your drag at the bottom of the tab, sometimes text in the terminal gets selected this way, but that's not necessary for this to happen)

Expected behavior

It shouldn't scroll up forever when you do that

Actual behavior

If the terminal can scroll up it will scroll up slowly and go on until you click in the terminal
video: https://www.youtube.com/watch?v=o0T1jeFemvQ

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 11, 2021
@zadjii-msft
Copy link
Member

Well that certainly looks insane. I can't get this to repro at all though, unfortunately. Who knows, maybe this will be made better with #1256, or far far worse. I guess we'll leave this open on the backlog for now.

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Feb 12, 2021
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Mar 26, 2021
@leduyquang753
Copy link

This looks like it has something to do with the auto-scroll behavior when dragging and dropping: when an object is being dragged by the cursor and the cursor is near an edge of a scrollable container, the container will think the user is wanting to scroll to reveal the portion of the container that the user wants to drop the object to. And Windows terminal's console container is also doing that except that it doesn't stop when the mouse has been released.

Screenshot at 12h47 20 23-04-2021

@zadjii-msft
Copy link
Member

the auto-scroll behavior when dragging and dropping

Is there some sort of Windows setting that controls that? Because we certainly didn't implement anything like that for the Terminal 😄 We do support "dragging a selection outside the control will scroll the control", but nothing for "dragged something over the edge of the control will scroll the control".

Holy crap I got it to repro. I figured out what's different between mine & OP's setup - you need to drag the tab into the padding. If you're in the padding, then we'll try and start an autoscroll, even without a selection.

This'll be a trivial fix once #9820 lands

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Repro We can't figure out how to make this happen. Please help find a simplified repro. labels Apr 23, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 23, 2021
@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) and removed Area-User Interface Issues pertaining to the user interface of the Console or Terminal labels Apr 23, 2021
@zadjii-msft zadjii-msft self-assigned this Jul 13, 2021
zadjii-msft added a commit that referenced this issue Jul 13, 2021
  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.
@ghost ghost added the In-PR This issue has a related PR label Jul 13, 2021
@ghost ghost closed this as completed in #10650 Jul 28, 2021
ghost pushed a commit that referenced this issue Jul 28, 2021
## 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.
@ghost ghost removed the In-PR This issue has a related PR label Jul 28, 2021
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Jul 28, 2021
@ghost
Copy link

ghost commented Aug 31, 2021

🎉This issue was addressed in #10650, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants