Closed Bug 1600414 Opened 1 year ago Closed 10 months ago

PiP player on YT animates/fades its size down to ~150x80

Categories

(Core :: Widget: Gtk, defect, P2)

72 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla75
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- unaffected
firefox72 --- wontfix
firefox73 --- verified
firefox74 --- verified
firefox75 --- verified

People

(Reporter: gwarser, Assigned: stransky)

References

(Blocks 1 open bug, Regressed 1 open bug, Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(6 files, 1 obsolete file)

Player will open in "normal" size for PIP and then animates pixel-by-pixel down to ~150x80 pixels

Screen capture https://mega.nz/#!LVBzHKYQ!_di5oXfepATVmY4iUru6kg1HlxPvWZdB3lSM_RCUCUY

Bisected to https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=48548c06b8e0cbd89c78a215e0ded8e9aa9ffd98&tochange=6293eb358d57465c23b90312af86938fbd75c8d3

Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0

Manjaro KDE

Has Regression Range: --- → yes
Regressed by: 1599421

Hm, I cannot reproduce this on a Gnome-based desktop, like Ubuntu. Hey Martin, does this sort of thing fall within your wheelhouse?

Flags: needinfo?(stransky)

Looks like Mint runs Cinnamon as its default desktop environment, which seems to be an early fork of Gnome 3.

Hey Sylvestre, what's the general playbook here when we have something that seems to be working in Gnome 3 environments, but seems more broken in other Linux desktop environments? Is MOZ_WIDGET_GTK the right pragma to put support behind?

Flags: needinfo?(sledru)

(In reply to Alice0775 White from comment #2)

Created attachment 9112903 [details]
image.png

I can reproduce on Nightly72.0a1 Linux MINT 19 Cinnamon, but not on Ubuntu18.04 Gnome.

Sorry my bad, please ignore comment#2. because the comment is not correct.
Youtube video resolution is different between them.
Pip size becomes small when low resolution youtube video playback.

@gwarser, can you please try to reproduce this issue on Release and the latest Nightly, in order to change the status of the flags.
I cannot reproduce this issue because I don't have Linux MINT 19 Cinnamon.

Flags: needinfo?(gwarser)

This was bisected to Bug 1599421

This does not happen on 70.0.1.
I'm pretty sure beta 71 was not affected, but was updated now to 72.0b1 and is affected.
Still happens on Nightly 73.0a1 20191202220401.

My system is Manjaro KDE.

Flags: needinfo?(gwarser)

I suspect it's caused by the aspect ratio when WM tries to shrink down the window to the correct aspect ratio but it fails. I saw similar bugs for Gnome before but it was fixed. I think we may not set the aspect ratio for the GtkWindow at Gtk level as it already causes some issues like Bug 1584790 and linux version of Bug 1535437 but rather we may keep the aspect on mind when resizing the window by gecko.

Flags: needinfo?(stransky)

Okay, thanks Martin. Why would this not be reproducible on, say, Ubuntu?

Flags: needinfo?(stransky)

(In reply to Mike Conley (:mconley) (:⚙️) (Wayyyy behind on needinfos) from comment #8)

Okay, thanks Martin. Why would this not be reproducible on, say, Ubuntu?

It looks like a window manager bug to me.

I played with the resize code a bit but without any luck yet.

Flags: needinfo?(stransky)

Bug 1602563 may help here. We may need some hack for KDE, I'll look at it when Bug 1602563 lands.

Bug 1602563 has landed. gwarser, are you still able to reproduce this issue on the latest Nightly?

Flags: needinfo?(gwarser)

Don't think you need my help now :)

Flags: needinfo?(sledru)

20191211094640 - still not fixed.

Flags: needinfo?(gwarser)

Thanks, gwarser.

Hm, so it doesn't seem like bug 1602563 helped here. What's the best way to prevent users with these sorts of buggy window managers from running into this problem? Or is this something those users are just going to have to accept?

Flags: needinfo?(stransky)

I tested KDE from Fedora 31 and it works fine so it's not a general KDE bug but rather some Manjaro KDE issue. It should be reported at Manjaro KDE bug tracking system, I don't think we're going to fix that.

Flags: needinfo?(stransky)

Sounds like wontfix for 72.

It sounds like this is mainly an issue with Manjaro KDE's window manager.

gwarser, if you're willing to wade upstream a little bit, I believe the Manjaro developers coordinate their work here: https://gitlab.manjaro.org

I recommend filing a bug with them. If and when you do, please comment back with a URL and we can link this bug to it.

I'm also going to move this to Core :: Widget Gtk, since this seems to be more about how Manjaro's window manager talks to our GTK widget layer.

Component: Video/Audio Controls → Widget: Gtk
Flags: needinfo?(gwarser)
Product: Toolkit → Core

I had no feedback on Reddit. After small problem with registration I tried asking on Manjaro official forum https://forum.manjaro.org/t/manjaro-kde-or-my-config-causes-firefox-pip-player-window-to-animate-its-size-down-to-150x80/115765 and at least have confirmation.

Can't make heads or tails out of gitlab.manjaro.org

Flags: needinfo?(gwarser)

Another report from "Nightly 73.0a1 (2019-12-18) (64-bit) Debian Unstable" also KDE - https://www.reddit.com/r/firefox/comments/ees2vw/picture_in_picture_shrinks_to_smallest_size/

I also have this issue on gentoo. Same behaviour with openbox but in addition can't even resize it back. Can resize with KDE kwin though.

I also have this issue on Fedora KDE. It only started with the update to Firefox 72. To test, I installed IceCat 68 and enabled picture-in-picture and the problem didn't arise.

Duplicate of this bug: 1608661

Screen recording of picture-in-picture bug in Firefox 72 on KDE. The distribution is Fedora KDE Spin.

I have this same issue on Arch using KDE. I did not have this problem with Firefox 71.

I have seen this in:

  • Kubuntu 18.04 LTS (no scroll bars on the video for this distro. Also no border with which to resize the video)
  • Kubuntu 19.10
  • Manjaro KDE
    All using Firefox 72.0.1.

Distros NOT affected by this bug:

  • Ubuntu 18.04 using Firefox 72.0.1
  • OpenSuse Tumbleweed using KDE and Firefox 71.0, PiP enabled through about:config.

In all cases my test was a clean install into VirtualBox, upgrade Firefox to latest in the repo, go to YouTube and play a video.

Comment 7 suggests aspect ratio may be a factor. I tried a few aspect ratios in VirtualBox with Kubuntu 19.10, wider than 2:1 and taller than 1:1, and always have the problem.

Just wanted to note that a workaround for KDE has been found: https://www.reddit.com/r/kde/comments/elztyj/customize_the_firefox72_pip_feature_in_kde/

The key settings seems to be the "Ignore the requested geometry" setting, although using that alone won't put the PiP window in the correct position.

Duplicate of this bug: 1607424

I suspect KDE does not like the aspect ratio setting although I can't reproduce that myself. We may sacrifice the aspect ratio setting on such configuration, maybe via a pref?

I managed to reproduce it, it's caused by wrong decoration size calculation on KDE. Can be fixed on Firefox side.

Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P2

I have a workaround for it. Full fix can be expected with Plasma 5.18 where CSD is supported.

  • Create header bar at GTK_WINDOW_TOPLEVEL
  • Use actual header bar widget as window titlebar because gtk_window_set_titlebar() sets "csd" and "solid-csd" styles.
    We need to read the styles to get correct decoration type.
  • Use MOZ_GTK_HEADERBAR_WINDOW to get decoration style at moz_gtk_header_bar_paint()
  • Don't return decoration size for solid-csd as it behaves as a regular window frame.

Depends on D59850

Pushed by aiakab@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9eb877be55ac
[Wayland] Use GTK_WINDOW_TOPLEVEL and actual header bar to create Gtk titlebar css style, r=jhorak
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/886e5afef990
[Wayland] Get CSD decoration styles from MOZ_GTK_HEADERBAR_WINDOW, r=jhorak
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74

Thanks, Martin! Presuming this fix is verified, do you think this patch is safe enough to request uplift to beta?

Flags: needinfo?(stransky)

Same issue with FF 72.0.1 running on Xubuntu 18.04 LST (with Xfce 4.12).
When trying to resize the PIP window gets back to 150x80 ratio.

(In reply to ben.mailhe from comment #37)

Same issue with FF 72.0.1 running on Xubuntu 18.04 LST (with Xfce 4.12).
When trying to resize the PIP window gets back to 150x80 ratio.

Please test latest nightly if it's fixed for you.
Thanks.

Flags: needinfo?(stransky) → needinfo?(ben.mailhe)

Comment on attachment 9120727 [details]
Bug 1600414 [Wayland] Get CSD decoration styles from MOZ_GTK_HEADERBAR_WINDOW, r?jhorak

Beta/Release Uplift Approval Request

  • User impact if declined: PIP Window is shrank to its minimal size on KDE
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: - run KDE and Firefox there
  • open Firefox, run video, move it to PIP
  • check if size of the window is preserved
  • List of other uplifts needed: None
  • Risk to taking this patch: Medium
  • Why is the change risky/not risky? (and alternatives if risky): Medium risk - we changed how titlebar style is generated. May affect titlebar look when system titlebar is disabled.
  • String changes made/needed: none
Attachment #9120727 - Flags: approval-mozilla-beta?
Attachment #9120726 - Flags: approval-mozilla-beta?
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

Comment on attachment 9120726 [details]
Bug 1600414 [Wayland] Use GTK_WINDOW_TOPLEVEL and actual header bar to create Gtk titlebar css style, r?jhorak

Fixes a PIP sizing bug on Linux. Approved for 73.0b7.

Attachment #9120726 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9120727 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

(In reply to Martin Stránský [:stransky] from comment #38)

(In reply to ben.mailhe from comment #37)

Same issue with FF 72.0.1 running on Xubuntu 18.04 LST (with Xfce 4.12).
When trying to resize the PIP window gets back to 150x80 ratio.

Please test latest nightly if it's fixed for you.
Thanks.

I tested with FF 74.0~1a and still have the "resize" issue. Might be my config or from Xfce side (I might try to update to 4.14).
Thanks!

Flags: needinfo?(ben.mailhe)

Sorry can't confirm fix with nighty/latest hg, same behaviour on kde or openbox on gentoo.

Kubuntu 18.04.3; Firefox 74.0a1 20200117213346; problem still here.

Still having the problem on Firefox 74.0a1 (2020-01-18) (64-bit), on Fedora 31 KDE Spin.

Tried to reproduce the issue with VMs for Fedora 31, Ubuntu 19.04 but to no success - Firefox 74.0a1 (2020-01-19).

In the end, managed to confirm the issue still being present with 74.0a1(2020-01-19)&(2020-01-16) on (VM with)Kubuntu 19.04.
Behavior is as per video in comment 23.

For 73.0b7, the very first try it appeared ok; after a pause each time I tried to start PIP it went on pause and it attempted to get smaller down to 97%-ish.
After a browser restart the issue was as per comment 23 as well.

@Martin, looking at the previous comments as well; best course would be updating the status for the report.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

(In reply to Martin Stránský [:stransky] from comment #7)

I suspect it's caused by the aspect ratio when WM tries to shrink down the window to the correct aspect ratio but it fails. I saw similar bugs for Gnome before but it was fixed. I think we may not set the aspect ratio for the GtkWindow at Gtk level as it already causes some issues like Bug 1584790 and linux version of Bug 1535437 but rather we may keep the aspect on mind when resizing the window by gecko.

That's right! For some reason GTK sets the base size on the picture-in-picture window. According to the ICCCM spec, one should subtract the base size prior to checking the aspect ratio. From KWin POV, we do nothing wrong.

https://gitlab.gnome.org/GNOME/gtk/merge_requests/1331

Clearing qe+ flag for tracking.
Please update once issue is fixed.

Flags: qe-verify+
See Also: → 1612732

Comment on attachment 9120726 [details]
Bug 1600414 [Wayland] Use GTK_WINDOW_TOPLEVEL and actual header bar to create Gtk titlebar css style, r?jhorak

Removing the Beta approvals to get this off the needs-uplift radar.

Attachment #9120726 - Flags: approval-mozilla-beta+
Attachment #9120727 - Flags: approval-mozilla-beta+

Use gdk_window_set_geometry_hints() instead of gtk_window_set_geometry_hints() as gdk_*
does not set base sizes which breaks KDE and other window managers.

Attachment #9124235 - Attachment description: Bug 1600414 [Wayland] Use gdk_window_set_geometry_hints() to set geometry hints, r?jhorak → Bug 1600414 Use gdk_window_set_geometry_hints() to set geometry hints, r?jhorak

Window aspect ratio is known to work correctly on Gnome only so apply it only there.

Comment on attachment 9124238 [details]
Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r?jhorak

This patch is intended as a workaround for 73 only.

Duplicate of this bug: 1612732
Duplicate of this bug: 1611377

Comment on attachment 9124238 [details]
Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r?jhorak

Beta/Release Uplift Approval Request

  • User impact if declined: PIP windows are shrank on KDE and other window managers.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: - run firefox
  • open PIP window
  • check it's visible and can be resized
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Linux only, only reads ENV variable and uses it to enable/disable aspect ratio set.
  • String changes made/needed: none
Attachment #9124238 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Status: REOPENED → NEW
Target Milestone: mozilla74 → ---

Comment on attachment 9124238 [details]
Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r?jhorak

73 is on release now

Attachment #9124238 - Flags: approval-mozilla-beta? → approval-mozilla-release?
Pushed by shindli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/93335e047c83
Use gdk_window_set_geometry_hints() to set geometry hints, r=jhorak
Backout by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/212385698b1e
Backed out changeset 93335e047c83 for causing mochitest and wpt failures on a CLOSED TREE

Thanks, I'll look at it.

Flags: needinfo?(stransky)

I encountered this bug, KDE Plasma 5.17.5 on ArchLinux.

Reproduced in Firefox 72.0.2 and Firefox Nightly 74.0a1 buildID. 20200204095729

Comment on attachment 9124238 [details]
Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r?jhorak

Restricts PiP to Gnome only where it's known to behave better. Approved for 73.0 RC2.

Attachment #9124238 - Flags: approval-mozilla-release? → approval-mozilla-release+

(In reply to Ryan VanderMeulen [:RyanVM] from comment #63)

https://hg.mozilla.org/releases/mozilla-release/rev/4280365e593b

Great!

I'm going to work on KDE fix (https://phabricator.services.mozilla.com/D61552) to pass the tests and land it on central.

Updating flags for flow.
Fix confirmed with 73.0; no more issue as one reported in comment 46.

Status: NEW → ASSIGNED

Okay, let's apply the workaround to central/beta too as gdk_window_set_geometry_hints() can cause other breakage. We can revisit later that when fixed Gtk version is used.

Window aspect ratio is known to work correctly on Gnome only so apply it only there.

Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a98ec6d23cb9
[Linux] Apply window aspect ratio to PIP on Gnome only, r=jhorak
Status: ASSIGNED → RESOLVED
Closed: 11 months ago10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75

Thanks for landing the workaround on central for now, I think that's the right call too. Please nominate for Beta approval when you get a chance.

Flags: needinfo?(stransky)
Attachment #9124235 - Attachment is obsolete: true

Comment on attachment 9126040 [details]
Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r?jhorak

Beta/Release Uplift Approval Request

  • User impact if declined: PIP window is shrank on KDE.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): disables aspect ratio setting on KDE.
  • String changes made/needed: none
Flags: needinfo?(stransky)
Attachment #9126040 - Flags: approval-mozilla-beta?

Comment on attachment 9126040 [details]
Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r?jhorak

Low risk, uplift approved for 74.0b3, thanks.

Attachment #9126040 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Fix verified with 74.0b3, 75.0a1(2020-2-14) on Kubuntu 19.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Regressions: 1616162
You need to log in before you can comment on or make changes to this bug.