-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Teach terminal to hide mouse while typing #8629
Conversation
New misspellings found, please review:
To accept these changes, run the following commands
✏️ Contributor please read thisBy default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
See the 🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The :check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation is pretty solid. Thanks!
I'm wondering if we should make this a setting? Or maybe we should test this out in WT Preview a bit to see to what level people want to configure it? Either way, I'm ok merging it as-is, then deciding on it's configurability later.
I didn't introduce a setting because we already read a system wide one. So I suggest trying this in preview and seeing what happens 😊 |
Systemwide setting >>> local one, always. EDIT: i mean, we do not need a local setting for this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when the cursor is hidden, and then terminal exits (or the pane closes or what-have-you?) Will the next terminal focused properly restore it to visible?
If the terminal exits / pane is hidden, the next terminal will not show the cursor until the mouse is moved. This is somewhat inconsistent, as switching between terminals does restore the cursor immediately. I will fix it. |
It may be fine if you don't fix it. As long as Windows restores it eventually. 😄 |
Fixed :) Actually it was important: open a terminal tab and settings tab, start typing in the terminal tab, then ctrl+w. Learn how to edit settings without a mouse 😄 |
@@ -2582,6 +2582,8 @@ namespace winrt::Microsoft::Terminal::TerminalControl::implementation | |||
{ | |||
if (!_closing.exchange(true)) | |||
{ | |||
_RestorePointerCursorHandlers(*this, nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. will this restore the cursor to pointer if a terminal closes while a different one is the one that hid it? The sleep 5; exit
scenario, but you go type in a different terminal tab while it's waiting to beef it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again this user who wants to destroy terminal? 😄
The restore is managed on the TerminalPage level - so we won't need to remember who hid it.
If I don't miss anything, in the worst case we will get mouse restored.. while typing.. and then it will be hidden again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it like this. This will be okay for now 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user who wants to destroy terminal
You'd be surprised! Look for posts by vefatica
here 😉 and there's also one Microsoft person who keeps reporting bugs in multibyte character handling because he apparently just runs a stress testing program that emits random code units and then he actively resizes the window while it's doing that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd be surprised! Look for posts by
vefatica
here 😉 and there's also one Microsoft person who keeps reporting bugs in multibyte character handling because he apparently just runs a stress testing program that emits random code units and then he actively resizes the window while it's doing that
After few months following the tracker I am not surprised with anything as the creativity is limitless 😊 And I am a big fan of vefatica quite for a while - even before he found the handle leak.
Thanks again! |
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
## PR Checklist * [x] Closes microsoft#5699 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. ## Detailed Description of the Pull Request / Additional comments * Use SPI_GETMOUSEVANISH setting * Hide upon CharacterReceived * Unhide upon PointerMoved, PointerMoved, MouseWheel, LoseFocus
Is there a settings/configuration option to disable this beaviour? I preferred it when the mouse pointer stayed visible all the time because it seems to rapidly flash between hidden & showing when typing, which gets very annoying. Also when the cursor is hidden and you move it up to the minimise/maximise/exit buttons it doesn't reappear. |
@viral32111 So, we're already checking the state of the system-wide Mouse vanish setting. So the terminal should be behaving in line with other apps. You could disable that setting if you wanted to have the cursor always visible. Now that I'm typing this up though, it seems like Edgium doesn't vanish the cursor as I type though. So maybe there should be an additional setting. notes: |
PR Checklist
Detailed Description of the Pull Request / Additional comments