Closed Bug 1757463 Opened 2 years ago Closed 11 months ago

Support Windows' "Hide pointer while typing" system setting to hide the mouse pointer


(Core :: Widget: Win32, enhancement, P3)




119 Branch
Tracking Status
relnote-firefox --- 119+
firefox-esr91 --- wontfix
firefox-esr102 --- wontfix
firefox-esr115 --- wontfix
firefox98 --- wontfix
firefox99 --- wontfix
firefox100 --- verified
firefox117 --- wontfix
firefox118 --- wontfix
firefox119 --- fixed


(Reporter: cpeterson, Assigned: handyman)




(2 files)

Windows has a "Hide pointer while typing" setting buried deep in its system settings, but it only works in applications that check the setting. The only Windows apps I've found that honor the setting are Notepad and WordPad. macOS hides the mouse pointer by default for all applications.

As someone who spends most of my workdays editing Google Docs and spreadsheets in Firefox, hiding the mouse pointer would be very nice. When I click to set focus in a doc and start typing, the cursor and text are obscured by the mouse pointer (because that's where I just clicked focus).

The setting can be accessed via SystemParametersInfo, specifically SPI_GETMOUSEVANISH:

I don't know if "Hide pointer while typing" setting is enabled by default. The setting probably exists for disable pointer hiding for backwards compatibility with some applications. Maybe we could implement the mouse pointer hiding, regardless of the "Hide pointer while typing" setting (since so few users will know about it).

Severity: -- → S3
Priority: -- → P3

Judging from this patch for this in Windows terminal, we don't need to expect surprises here. We could just call ShowCursor(FALSE) on a keypress message and ShowCursor(TRUE) on a mouse event or window deactivation. Even our current cursor hiding isn't a concern since it uses an entirely different mechanism -- we are showing a transparent arrow for cursor: none instead of hiding the cursor. The current fullscreen handler would mix with it but I'm sure that the cursor reappearing when we switch to fullscreen wouldn't be an issue.

We need to hide the pointer when we detect a keypress and unhide it when we get any mouse event or window deactivation. We only do this if the Windows "Hide pointer while typing" setting is turned on (it is on by default). We currently also put this behind the Firefox pref "".

Assignee: nobody → davidp99

(In reply to Chris Peterson [:cpeterson] from comment #0)

The "Hide pointer while typing" setting is disabled by default, probably to avoid breaking backwards compatibility with some applications. Maybe we could implement the mouse pointer hiding, regardless of the "Hide pointer while typing" setting (since so few users will know about it).

I think this is on by default. This is on on two of my machines (Windows 10). I suppose its possible that I set it on both but, since I didn't know it existed, that seems unlikely.

Thanks David Parks [:handyman] for checking relevant reports.
I'd like to refer to my previous comment on this matter: Bug 489407 Comment #4
I'm still on X11 waiting for an implementation of this. Thank you.

Thanks for the report Gyorgy. These bugs are for Windows. I don't know if this is an issue that we currently have a Linux bug for but I don't immediately see one. You may want to track one down or file a new one if you can't find any.

It looks like the Mac already does this with [NSCursor setHiddenUntilMouseMoves]

Jamie: you, or someone on the Accessibility team with Windows experience, might want to review this patch. Could hiding the mouse pointer when the user starts typing cause problems for accessibility software?

Flags: needinfo?(jteh)

I can't think of any a11y concerns here. I guess the mouse pointer disappearing could perhaps be a concern for some users with cognitive disabilities, though moving the mouse will immediately bring it back. Also, a user can disable it with the Windows setting if they need to.

It's worth noting that the setting is difficult to find; it isn't available in the modern Settings app yet, so you can't, for example, search for "hide pointer". Thus, to be safe, if we do enable this by default at some point, we should keep the pref around for a while just in case we get a bunch of users who are hurt by this and they have trouble finding the Windows setting.

Flags: needinfo?(jteh)
Pushed by
Support "Hide pointer while typing" on Windows r=cmartin
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

Should this be in about:preferences#experimental?

See Also: → 1759558

I've been testing for a few days now and haven't found any bugs besides the minor issues already reported in bug 1759558.

(In reply to Kagami :saschanaz from comment #11)

Should this be in about:preferences#experimental?

I think we're just going to turn it on and let it ride the trains. After playing with it, it doesn't look like it has any serious edge cases. I'd like to deal with the things in bug 1759558 first but they are minor and not important.

Regressions: 1774453
Duplicate of this bug: 1817703

Due to issues like bug 1774453, we turned off the support by default. We can turn it back on if we address the issues there -- essentially, it needs to be DOM aware and probably limited to use with the proper inputs, like text fields.

Resolution: FIXED → ---

This only hides the cursor if it's on the page you're editing, but given
that the point of the feature is to move the cursor out of the way, that
seems acceptable (and honestly it feels more of a feature than a bug).

This should work across platforms (though non-windows platforms need
ui.hideCursorWhileTyping=1 in about:config to enable).

I forgot why I never landed this.

Pushed by
Implement hide cursor while typing at the DOM+Editor level. r=handyman,masayuki
Pushed by
Avoid getting a pres context when detached from the editor.
Closed: 2 years ago11 months ago
Resolution: --- → FIXED

Release Note Request (optional, but appreciated)
[Why is this notable]: Implements a Windows setting that is turned on by default.
[Affects Firefox for Android]: No
[Suggested wording]: Mouse cursor will now disappear when typing on Windows if the relevant system setting says so.
[Links (documentation, blog post, etc)]: See comment 0

relnote-firefox: --- → ?

Added a slightly reworded note to the Fx119 Nightly release notes. Keeping the relnote? flag open to keep it on the radar for inclusion in our final release notes.

Depends on: 1851641
Target Milestone: 100 Branch → 119 Branch
See Also: → 1852365
QA Whiteboard: [qa-119b-p2]
You need to log in before you can comment on or make changes to this bug.