-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Win32 mouse coordinates wrong when viewport scrolled #10190
Comments
If I had to guess, this is a regression from the recent Interactivity work in TermControl. @zadjii-msft mind having a look? |
Confirming that all mouse mode input happens relative to the control and not to the viewport after #9820. |
It looks like this isn't a regression from 1.8 (Stable) due to the Control/Interactivity refactoring. I'm going to demote it back to P2 and schedule it for 1.11! |
## Summary of the Pull Request Adjust the y-coordinate of the mouse coordinates we send based on how much the viewport has been scrolled ## Validation Steps Performed Validated: cannot repro the issue in microsoft#10190 Closes microsoft#10190
🎉This issue was addressed in #10642, which has now been successfully released as Handy links: |
🎉This issue was addressed in #10642, which has now been successfully released as Handy links: |
I still see the buggy behavior on Terminal 1.11.2421.0, which is supposed to have this fix. |
Huh. I am as well. @PankajBhojwani, did this regress? If so, why didn't the test catch it? |
This never regressed, turns out we only did the mouse coordinate adjustment for pointer pressed, not for release/move/wheel 🤦 Pushed a PR for it, and the test didn't catch it because we don't actually have a way right now to test if mouse events were generated |
🎉This issue was addressed in #11290, which has now been successfully released as Handy links: |
🎉This issue was addressed in #11290, which has now been successfully released as Handy links: |
🎉This issue was addressed in #11290, which has now been successfully released as Handy links: |
PR #10642 and #11290 introduced an adjustment for the cursor position used to generate VT mouse mode events. One of the decisions made in those PRs was to only send coordinates where Y was >= 0, so if you were off the top of the screen you wouldn't get any events. However, terminal emulators are expected to send _clamped_ events when the mouse is off the screen. This decision broke clamping Y to 0 when the mouse was above the screen. The other decision was to only adjust the Y coordinate if the core's `ScrollOffset` was greater than 0. It turns out that `ScrollOffset` _is 0_ when you are scrolled all the way back in teh buffer. With this check, we would clamp coordinates properly _until the top line of the scrollback was visible_, at which point we would send those coordinates over directly. This resulted in the same weird behavior as observed in #10190. I've fixed both of those things. Core is expected to receive negative coordinates and clamp them to the viewport. ScrollOffset should never be below 0, as it refers to the top visible buffer line. In addition to that, #17744 uncovered that we were allowing autoscrolling to happen even when VT mouse events were being generated. I added a way for `ControlInteractivity` to halt further event processing. It's crude. Refs #10190 Closes #17744
Windows Terminal version (or Windows build number)
1.9.1445.0
Other Software
Using Yori's mouseover support, but anything else should work. It's just unnatural to observe this with a TUI application like FAR manager (why scroll the viewport for a full screen TUI application?) However, scrolling the viewport should show the same behavior for anything.
Steps to reproduce
Expected Behavior
Since I know Dustin doesn't like the idea of applications being able to address regions that have scrolled off the visible portion of the display at the bottom, I was expecting the application to observe coordinates corresponding to mouse location if that location is visible at the bottom of the viewport. If the cell is not visible at the bottom of the viewport, I was expecting the reported location to be capped.
Actual Behavior
The reported mouse coordinates assume that the window has not scrolled and report coordinates on the assumption that the visible viewport is the same as the bottom of the scroll region. This causes the application to highlight/select the wrong text, several lines below where the mouse is positioned.
The text was updated successfully, but these errors were encountered: