microsoft / terminal

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

Preview - Mouse cursor doesn't reappear when switching workspaces during mouse hide #8958

Open nmelnick opened 3 years ago

nmelnick commented 3 years ago

Environment

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

Any other software?
Hopefully none applicable, but:
* Switching between tasks in Terminal and Edge
* Lenovo Vantage and/or ELAN TrackPoint
* PowerToys

Steps to reproduce

Expected behavior

Mouse cursor reappears on workspace switch

Actual behavior

Mouse cursor remains invisible (unless you change the size in mouse settings, or find the title bar and maximize/restore the window)

Don-Vito commented 3 years ago

@nmelnick - I am trying to reproduce it, but without any success. I don't have Lenovo and trackpoint though. This is what I do:

Can you please review my steps? Few other questions:

This is extremely interesting / weird as the cursor is restored the moment the terminal in the tab loses focus.

nmelnick commented 3 years ago

@Don-Vito Thanks for the reply!

Hm. Yesterday, I had a mouse connected, today, I'm TrackPoint only, so yesterday was testing with a mouse. I obviously cannot remove the TrackPoint entirely, but I don't currently have another Windows machine to test with.

I attempted to recreate your steps, with the difference of the WSL2 tab being my default tab. I put Edge on my second workspace, Terminal on my first.

I then duplicated this with a PowerShell Core tab and a PowerShell tab, and the same behavior occurs. I attempted the same action without Edge, and instead, just Notepad on the second desktop, and the same thing occurs.

I'm going to attempt to borrow another machine today, install the preview, and see if I can duplicate or if I have something incredibly weird on my machine.

Don-Vito commented 3 years ago

@nmelnick - thanks for the insights! Do you say that the mouse isn't shown in the second workspace (the one containing the Edge) as well?

nmelnick commented 3 years ago

@Don-Vito That's correct. The cursor is not shown in the next workspace, including attempting to mouse around in Edge. Mouseover events still fire, just no visible cursor. If I go back to the Terminal workspace, and press a key in it, then mouse around, the cursor will reappear. It seems that the event to show the cursor is not firing when I switch workspaces with the cursor in a hidden state.

Don-Vito commented 3 years ago

@Don-Vito That's correct. The cursor is not shown in the next workspace, including attempting to mouse around in Edge. Mouseover events still fire, just no visible cursor. If I go back to the Terminal workspace, and press a key in it, then mouse around, the cursor will reappear. It seems that the event to show the cursor is not firing when I switch workspaces with the cursor in a hidden state.

@DHowett - I am starting to lose my confidence of understanding windows internals. How can changing a cursor for a window in one app, to affect the cursor in the window of another process (in another workspace).

zadjii-msft commented 3 years ago

starting

Yea, controlling how the pointer looks is a special type of hell, for whatever reason. It's why #5028 is still blocked 😕

Don-Vito commented 3 years ago

starting

Yea, controlling how the pointer looks is a special type of hell, for whatever reason. It's why #5028 is still blocked 😕

I mean if this is possible then one app can screw the entire OS that easily :blush:

Darival commented 3 years ago

I'm experiencing the same behavior, when I start typing on the terminal the cursor disappears, then if I switch workspace it stays invisible even if switch back to the workspace containing the terminal. I have to type something on the terminal and then move the mouse for it to reappear.

Is there any way to disable cursor disappearing when typing in the terminal?

Don-Vito commented 3 years ago

Currently this behavior is controlled by the global seetting:

Screenshot_20210401-193212_Google.jpg

Does it reproduce consistently? Can you please share a repro steps?

zadjii-msft commented 3 years ago

Okay despite the fact that e don't really have a repro for this bug - I had an idea that might help with this and also #1441. Maybe we should at the IslandWindow level restore the mouse pointer when the window loses focus. This might prevent us from polluting the global pointer state.

I guess it doesn't help with the intra-app pollution that we were seeing (where it's Hard to switch the cursor only while over a single control), but an idea nonetheless

DHowett commented 3 years ago

This is a good idea.

MPeti1 commented 2 years ago

I have experienced this too for some time. I never understood why does it happen, but then moved one instance of the terminal to an other workspace and then it happened every single time I switched from a workspace with maximized WT to a workspace with Firefox, or basically any other program.

Some things I noticed: If I'm on a workspace that has an instance of WT, type something so the mouse disappears, and then switch to one that also has an instance of WT, and type something there, after moving the mouse it reappears correctly. Window size does not seem to matter.

Also, for those who don't want to disable cursor hiding while typing: a Ctrl+Alt+Delete and then Esc also makes the cursor visible. It's still annoxing, but quicker. But I'm now going to disable that cursor hiding option :D

However, I have a regular mouse (though wireless and has extra buttons, but that probably doesn't matter), so if the devs have questions or a beta patch, let me know if I can help with investigating this.

phortunate commented 11 hours ago

I am having the same issue as well. If the mouse is hidden when the desktop is switched it remains hidden on the new desktop. The only way to make it visible is to go back to the application that hid the mouse and move it around until the mouse becomes visible.

I have disabled "Hide pointer while typing" but this doesn't help when viewing a video and the mouse is hidden by the video player. If you change desktops the mouse remains hidden.

Is there an option to make the mouse always visible?

While keeping the mouse visible