Skip to content

Win32 mouse coordinates wrong when viewport scrolled #10190

@malxau

Description

@malxau

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

  1. Fill the console with output until it scrolls.
  2. Manually scroll the viewport up.
  3. Generate mouse events and observe the coordinates that the event contains.

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.

terminal_mouseover

Metadata

Metadata

Labels

Area-InputRelated to input processing (key presses, mouse, etc.)Issue-BugIt either shouldn't be doing this or needs an investigation.Priority-2A description (P2)Product-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions