Closed Bug 1273091 Opened 4 years ago Closed 3 years ago

Mouse cursor does not disappear in html5 fullscreen video on Windows

Categories

(Core :: Widget: Win32, defect, P1)

44 Branch
x86_64
Windows
defect

Tracking

()

VERIFIED FIXED
mozilla53
Tracking Status
firefox46 --- wontfix
firefox47 - wontfix
firefox48 + wontfix
firefox49 + wontfix
firefox50 --- wontfix
firefox51 --- verified
firefox52 --- verified
firefox53 --- verified

People

(Reporter: algkmn, Assigned: handyman)

References

Details

(Keywords: regression, Whiteboard: tpi:+)

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160502172042

Steps to reproduce:

when I go fullscreen video on youtube, mouse cursor doesn't disappear. if I move mouse cursor a little bit in fullscreen video mouse cursor disappears

fyi: 
I tried disable all add-ons, uninstall and clean install after all of this I reinstall fresh windows10 then install firefox (without any addons or settings) it were still happening.

it's not happening on chrome, opera, or edge.

sorry my bad english

Gif explains issue: https://vgy.me/PrzI48.gif


Actual results:

mouse corsor does not disappear when go fullscreen


Expected results:

mouse corsor should disappear when go fullscreen
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
Are you using a software to manage your mouse?
no, I am using mac os x mouse cursor theme. (problem already happening before using this theme)
User Agent 	Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:49.0) Gecko/20100101 Firefox/49.0
Build ID 	20160519030232

The issue is reproducible on Windows. I tested on Windows 10 and Windows 7, and on both systems this is reproducible. I used the current release (46.0.1) and latest Nightly (49.0a1).

I tried to make a regression range and found this pushlog:

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=8021382da9722db0ad97ebd93698b69a74f0d9b0&tochange=5efb9a11196ba113b830cf4717d85513e3468783

Note: On Mac OS X 10.11 and Ubuntu 15.04 this is not reproducible.
Status: UNCONFIRMED → NEW
Component: Untriaged → Widget: Win32
Ever confirmed: true
OS: Windows 10 → Windows
Product: Firefox → Core
Version: 46 Branch → Trunk
Summary: mouse cursor does not dissappear in html5 fullscreen video → Mouse cursor does not disappear in html5 fullscreen video on Windows
Wow, they weren't kidding when they tried to warn me that fixing bug 506815 permanently was fraught with peril.

I don't know what code is responsible for hiding the cursor. Can anyone point me in the right direction?

Random speculation: we're waiting for a mouseleave or change in the mouse tracking window which, in pre-506815, would occur on the next 200ms timer edge when we hittested. Post-506815, Windows may wait for the first mouse event over a non-app window... or something. Not sure.
Flags: needinfo?(chutten)
Let's track this for 48/49 since the mouse cursor should disappear.
jonathan, can you help shed some light here or help find an owner for this bug? You have won the award for fixing a bunch of recent bugs in this component. The prize is a needinfo!
Flags: needinfo?(jfkthame)
FWIW I am using win10 and I cannot repro this issue.
this is a valid bug but not a release blocker for Fx47. Too late for uplifting a fix.
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #7)
> jonathan, can you help shed some light here or help find an owner for this
> bug? You have won the award for fixing a bunch of recent bugs in this
> component. The prize is a needinfo!

Gee, thanks! I should've known better than to touch it... ;)

I'm afraid I don't really know anything about the event handling / cursor management going on here. Maybe Masayuki would be a bit more familiar with this?
Flags: needinfo?(jfkthame) → needinfo?(masayuki)
I guess that opening fullscreen window doesn't cause synthesized mousemove event or it's fired before setting CSS cursor property on the fullscreen window.
Flags: needinfo?(masayuki)
David can you help find an owner for this bug? Thanks!
Flags: needinfo?(dbolter)
Jim any ideas who could take a look? (Masayuki, feel free to take this one if you want)
Flags: needinfo?(dbolter) → needinfo?(jmathies)
I'm not able to reproduce. Tracy can you work up good str here? Maybe the trick is to use the keyboard to go into fullscreen without moving the mouse.
Flags: needinfo?(jmathies) → needinfo?(twalker)
Priority: -- → P1
Whiteboard: tpi:+
(In reply to Jim Mathies [:jimm] from comment #14)
> I'm not able to reproduce. Tracy can you work up good str here? Maybe the
> trick is to use the keyboard to go into fullscreen without moving the mouse.

Nope, just load any YT video like https://www.youtube.com/watch?v=Ex8kDMKnLaE then click on the fullscreen icon and don't touch the mouse anymore. You'll see the mouse pointer doesn't disappear.
Yes, Loic is correct on STR:

1) load https://www.youtube.com/watch?v=Ex8kDMKnLaE 
2) click on the fullscreen icon
3) do no move mouse after step 2 click

Expected results:  mouse pointer disappears

Tested results: finger point mouse pointer remains

This is Windows only.

Win 7 (VM), Nightly, 51.0a1, 20160802030437 - FAIL (e10s and non-e10s window)
Mac 10.11, Nightly, 51.0a1, 20160802030437 - PASS
Ubuntu 14.04(VM), Nightly 51.0a1, 20160802030437 - PASS
Flags: needinfo?(twalker)
by the way I guess it's happening every single html5 full screen content. not only videos. (I'm not sure)

thank you
Hi Jim,
Do you have any idea who can help on this important issue?
Flags: needinfo?(jmathies)
Aaron is going to poke at this when he has a chance.
Assignee: nobody → aklotz
Flags: needinfo?(jmathies)
Marking fix-optional for 49 because late in beta, but we really really hope for a fix here.
is there any hope to fix this issue? :)
Aaron, have you had any time to take a look?
Flags: needinfo?(aklotz)
Assignee: aklotz → nobody
Flags: needinfo?(aklotz)
Jim, do you know who could investigate?
Flags: needinfo?(jmathies)
Yep, spoke with davidp, he's going to take a look at this.
Assignee: nobody → davidp99
Flags: needinfo?(jmathies)
Comment on attachment 8812873 [details] [diff] [review]
Send an eMouseEnterIntoWidget immediately after entering fullscreen

Hi, Masayuki.  Hopefully, you're a good pick to review this.

The deal was that the OS sends a WM_MOUSELEAVE, which triggers a eMouseExitFromWidget.  This the mouse position stored in the PresShell is cleared by this message:
https://dxr.mozilla.org/mozilla-central/rev/0534254e9a40b4bade2577c631fe4cfa0b5db41d/layout/base/nsPresShell.cpp#6787

There are a number of synthetic mouse moves sent after that but they are all ignored since the mouse position is invalid:
https://dxr.mozilla.org/mozilla-central/rev/0534254e9a40b4bade2577c631fe4cfa0b5db41d/layout/base/nsPresShell.cpp#5495

By sending the eMouseEnterIntoWidget when we are done entering fullscreen instead of waiting for the next mouse move, we restore the presshell's mouse position cache:
https://dxr.mozilla.org/mozilla-central/rev/0534254e9a40b4bade2577c631fe4cfa0b5db41d/layout/base/nsPresShell.cpp#6762
Attachment #8812873 - Flags: review?(masayuki)
Comment on attachment 8812873 [details] [diff] [review]
Send an eMouseEnterIntoWidget immediately after entering fullscreen

># HG changeset patch
># User David Parks <dparks@mozilla.com>
># Date 1479755237 28800
>#      Mon Nov 21 11:07:17 2016 -0800
># Node ID 022089979908a86fbd83a0181ffb2f5df06104f4
># Parent  79feeed4293336089590320a9f30a813fade8e3c
>Bug 1273091 - Mouse cursor does not disappear in html5 fullscreen video on Windows
>When we jump to fullscreen, the OS sends a WM_MOUSELEAVE, which we turn into a eMouseExitFromWidget.  The eMouseEnterIntoWidget was previously only sent when the mouse moved into the widget, which required the mouse to move.  When entering fullscreen, we want the eMouseEnterIntoWidget to happen right away.

Did you test this patch with multi-display?

>+// Used to remember the wParam (i.e. currently pressed modifier keys)
>+// and lParam (i.e. last mouse position) in screen coordinates from
>+// the previous mouse-exit.  This is static since it is not
>+// associated with a particular widget (since we exited the widget).
>+static WPARAM sMouseExitwParam = 0;
>+static LPARAM sMouseExitlParamScreen = 0;

I'd be happy if these are static member of nsWindow because they're not referred from outside of nsWindow.

r=masayuki if this works fine even in multi-display.
Attachment #8812873 - Flags: review?(masayuki) → review+
Checked with multiple displays -- the behavior is correct.

Also made the static values members of nsWindow.
Attachment #8812873 - Attachment is obsolete: true
Keywords: checkin-needed
Thanks for fixing this, David! \o/
Yes, this bug was so annoying when watching video in FS mode on YouTube.
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/efad76d74c06
Mouse cursor does not disappear in html5 fullscreen video on Windows. r=masayuki
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/efad76d74c06
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Too late to fix in 50.1.0 release
Hi :handyman, 
Is this worth uplifting to Beta51?
Flags: needinfo?(davidp99)
Hey Gerry,

Jimm had some thoughts about pushing this to Aurora/Beta -- he wanted to wait a bit to see if any regressions came up.  Jim, do you think we're good to uplift this?  Aurora _and_ beta?
Flags: needinfo?(davidp99) → needinfo?(jmathies)
(In reply to David Parks [:handyman] from comment #35)
> Hey Gerry,
> 
> Jimm had some thoughts about pushing this to Aurora/Beta -- he wanted to
> wait a bit to see if any regressions came up.  Jim, do you think we're good
> to uplift this?  Aurora _and_ beta?

Yes, go ahead and flag for aurora and beta. You'll need to fill out a short uplift form that the request will populate in bugzilla.
Flags: needinfo?(jmathies) → needinfo?(davidp99)
Comment on attachment 8815043 [details] [diff] [review]
Send an eMouseEnterIntoWidget immediately after entering fullscreen (r=masayuki)

Approval Request Comment
[Feature/Bug causing the regression]:
N/A
[User impact if declined]:
Mouse cursor lingers after taking video into fullscreen (until further mouse movement).  This is annoying for media consumers.
[Is this code covered by automated tests?]:
No, the only testing was manual visual confirmation against 32 and 64-bit builds, in single and multiple-monitor configurations.
[Has the fix been verified in Nightly?]:
Yes
[Needs manual test from QE? If yes, steps to reproduce]: 
No, but STR is in comment 16.
[List of other uplifts needed for the feature/fix]:
N/A
[Is the change risky?]:
No.
[Why is the change risky/not risky?]:
The patch simply sends a synthetic mouse move when going to fullscreen.  (Synthetic) mouse moves are highly unlikely to inspire any significant surprises.
[String changes made/needed]:
None
Flags: needinfo?(davidp99)
Attachment #8815043 - Flags: approval-mozilla-beta?
Attachment #8815043 - Flags: approval-mozilla-aurora?
Comment on attachment 8815043 [details] [diff] [review]
Send an eMouseEnterIntoWidget immediately after entering fullscreen (r=masayuki)

hide mouse for fullscreen video on windows, take in aurora52
Attachment #8815043 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 8815043 [details] [diff] [review]
Send an eMouseEnterIntoWidget immediately after entering fullscreen (r=masayuki)

Fix a regression for mouse cursor lingers after taking video into fullscreen. Beta51+. Should be in 51 beta 8.
Attachment #8815043 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
I've reproduced the initial issue on Windows 7 x64 using Nightly 51.0a1 (2016-08-23). 

Verified fixed on Windows 7 x64 using latest Nightly 53.0a1 (buildID: 20161227030213), latest Aurora 52.0a2 (buildID: 20161227004018) and Firefox 51 Beta 10 (buildID: 20161222080852): finger point mouse disappears.
This seems NOT to be fixed when watching an Amazon Prime Video. It happens again. Usually the first video you see it's ok, but then from the second the cursor is still there, fullscreen or not, and there is no way to get rid of it.

FF 54
(In reply to Stefano Mariani from comment #43)
> This seems NOT to be fixed when watching an Amazon Prime Video. It happens
> again. Usually the first video you see it's ok, but then from the second the
> cursor is still there, fullscreen or not, and there is no way to get rid of
> it.
> 
> FF 54

Please file a new bug.
Depends on: 1437941
You need to log in before you can comment on or make changes to this bug.