microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.21k stars 8.27k forks source link

Pressing Alt-hotkey shows mouse cursor, it won't auto-hide anymore until mouse is moved #14881

Open stasjok opened 1 year ago

stasjok commented 1 year ago

Windows Terminal version

1.16.10261.0

Windows build number

19044.2604

Other Software

No response

Steps to reproduce

  1. Open terminal
  2. Start typing. Mouse cursor is hidden.
  3. Press alt-hotkey, e.g. Alt+a. Mouse cursor is visible again. Do not move mouse.
  4. Type anything. Mouse cursor won't hide anymore.

Expected Behavior

After pressing Alt+a cursor should stay hidden. And even if not, it should hide after entering any letter.

Actual Behavior

Mouse cursor is reappearing after pressing Alt+a and is not hiding after typing.

carlos-zamora commented 1 year ago

We can't seem to repro this. Any chance you have Narrator or some other tool (Magnifier?) running? Those tend to mess with the Alt key, is why we ask.

elsaco commented 1 year ago

Could repro on Win10 and wt 1.17.1023. Notice that the pointer doesn't hide after pressing Alt+a:

https://user-images.githubusercontent.com/3933920/220799348-e9798f12-bc0a-47a8-90c6-25c29b81778d.mp4

Didn't try on Win11.

stasjok commented 1 year ago

We can't seem to repro this. Any chance you have Narrator or some other tool (Magnifier?) running? Those tend to mess with the Alt key, is why we ask.

No, I don't use any of these.

heysujal commented 1 year ago

@carlos-zamora I found this _RestorePointerCursorHandler method in TerminalPage.cpp which is being used to restore the pointer.

prob

I think it is missing a check for _shouldMouseVanish . For example _shouldMouseVanishalong with _isMouseHiddenis being used in _HidePointerCursorHandler in below screenshot

image

If the above screenshots are relevant then we can just add a check for_shouldMouseVanish (which should be false) like this

sol

I didn't run this project in my local system yet . I am only telling this by only observing the code. If I get approval I will run try to build and will try to see if it actually works and the make a PR. @zadjii-msft Can you have a look ?

jjvliu commented 10 months ago

I can reproduce the issue using Windows Terminal version 1.18.3181.0 on Windows 11 build number 22621.2715.

Similarly not using any tools (Narrator or Magnifier). I also noticed that I can restore auto-hide using Alt-Tab or Win-Tab, but not Win (toggling the start menu).

harg commented 2 months ago

I also confirm this issue : Windows 10 + Terminal 1.20.11781.0