PiP close button acts as unPiP button when Firefox is out of focus
Categories
(Toolkit :: Picture-in-Picture, defect, P2)
Tracking
()
People
(Reporter: asafko, Assigned: kpatenio)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-MR1-2022])
Attachments
(1 file)
Close and UnPiP buttons are supposed to work in different ways that account for specific use cases each of them has (get rid of the video vs return to it). Currently, we have a problem with Scenario #3 on this list:
Scenario 1 (close button + Firefox is in focus)
- Launch PiP window
- Navigate away from the origin video tab, but stay in Firefox.
- Click on the close button in the PiP window.
Expected result: PiP window closes, video in the origin tab is paused. The origin video tab is not put in focus.
Actual result: as expected
Scenario 2 (close button + Firefox is out of focus)
- Launch PiP window
- Navigate away from the origin video tab and put another application into the focus.
- Click on the close button in the PiP window.
Expected result: PiP window closes, video in the origin tab is paused. Firefox does not return in focus.
Actual result: Firefox returns in focus and opens the origin video tab. At least one user reports the video doesn’t pause.
Scenario 3 (unpip button + Firefox is in focus)
- Launch PiP window
- Navigate away from the origin video tab, but stay in Firefox.
- Click on the unpip button in the PiP window.
- PiP window closes, Firefox returns in focus and opens the origin video tab, the origin video is not paused.
Actual result: as expected
Scenario 4 (unpip button + firefox is out of focus)
- Launch PiP window
- Navigate away from the origin video tab and put another application into the focus.
- Click on the unpip button in the PiP window.
- PiP window closes, Firefox returns in focus and opens the origin video tab, the origin video is not paused.
Actual result: as expected
The problem with Scenario 3 might have been introduced as a part of this patch:
https://bugzilla.mozilla.org/show_bug.cgi?id=1687808 (possibly due to the ambiguity of what "de-activate PiP" means).
Updated•3 years ago
|
It appears that even if we press the close button, we still end up refocusing onto firefox. This is caused by the method _focusPipBrowserWindow, which is called in the method closeSinglePipWindow
that is ultimately responsible for closing the pip window (regardless if unpipping or actually pressing the x icon). Scenario 1 looks like it works as expected because we are already focused on the browser by the time _focusPipBrowserWindow
is called.
I think all we need to do is remove _focusPipBrowserWindow
to prevent refocusing when pressing the close button. This does not affect unpipping since there is already another method focusTabAndClosePip responsible for focusing us back onto the original video's page.
Comment 4•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 5•3 years ago
|
||
I've managed to reproduce this issue only on Mac OS and Ubuntu 20 (Would not reproduce in Ubuntu 22 with Wayland by default or in Windows 10).
This issue no longer reproduces in last Nightly v100.0a1 from 2022-03-15 or Beta v99.0b4.
Updated•3 years ago
|
Description
•