terminal icon indicating copy to clipboard operation
terminal copied to clipboard

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

Open nmelnick opened this issue 4 years ago • 13 comments

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

  • In a WSL 2 bash terminal, begin typing
  • Watch the mouse cursor disappear
  • Switch workspaces without moving the mouse (Ctrl-Win-Left/Right)

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)

nmelnick avatar Jan 29 '21 22:01 nmelnick

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

  • Open Terminal (not maximized)
  • Open WSL2 Ubuntu tab with bash
  • Start typing so the mouse disappears
  • Ctrl-Win-Right to switch to the next workspace with Edge open
  • Browse in edge without a mouse
  • Ctrl-Win-Left to return to the original workspace
  • The cursor is visible

Can you please review my steps? Few other questions:

  • Does this behavior depend on the location of the pointer?
  • Can you please try to repro it using a mouse rather than track point?

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

Don-Vito avatar Jan 30 '21 07:01 Don-Vito

@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.

  • Open Terminal, not maximized. Terminal opens with a WSL2 tab.
  • Hit enter, cursor disappears
  • Ctrl-Win-Right to go to my Edge tab without moving the mouse
  • Move the mouse, no cursor exists (however, a cursor is there, as objects highlight)
  • Ctrl-Win-Left to original workspace, where Terminal remains the active application
  • Mouse does not exist
  • Note: If I type again in the Terminal, and then mouse out, the cursor does reappear -- but ONLY if I type in the Terminal first, and then mouse out

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.

nmelnick avatar Jan 30 '21 17:01 nmelnick

@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?

Don-Vito avatar Jan 30 '21 17:01 Don-Vito

@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.

nmelnick avatar Feb 01 '21 18:02 nmelnick

@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).

Don-Vito avatar Feb 01 '21 20:02 Don-Vito

starting

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

zadjii-msft avatar Feb 01 '21 21:02 zadjii-msft

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:

Don-Vito avatar Feb 01 '21 21:02 Don-Vito

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?

Darival avatar Mar 31 '21 07:03 Darival

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?

Don-Vito avatar Apr 01 '21 16:04 Don-Vito

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

zadjii-msft avatar Apr 13 '21 19:04 zadjii-msft

This is a good idea.

DHowett avatar Apr 14 '21 02:04 DHowett

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.

MPeti1 avatar Dec 22 '21 15:12 MPeti1

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

phortunate avatar Jun 28 '24 21:06 phortunate