Open Bug 1587869 Opened 5 years ago Updated 3 years ago

Picture in Picture window is misaligned, 1-2 pixels outside the screen on non-wayland Linux

Categories

(Toolkit :: Picture-in-Picture, defect, P4)

Desktop
Linux
defect

Tracking

()

Tracking Status
firefox-esr91 --- affected
firefox98 --- affected
firefox99 --- affected
firefox100 --- affected

People

(Reporter: sdk, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-MR1-2022])

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

  1. Go to youtube.com
  2. Play any video
  3. Toggle PiP on

Actual results:

PiP window open misaligned in floating mode in the bottom left corner of the screen. By misaligned, I mean that a few pixel (right and bottom part) of the PiP is offscreen.

Expected results:

PiP window should show entirely on the screen

Component: Untriaged → Video/Audio Controls
Product: Firefox → Toolkit
Summary: Picture in Picture misaligned → Picture in Picture window is misaligned/partly outside the screen
Blocks: videopip
Summary: Picture in Picture window is misaligned/partly outside the screen → Picture in Picture window is misaligned/partly outside the screen on bspwm

I can reproduce this issue on bspwm with an example/default configuration [1].

In the example configuration, border_width is set to 2 pixels.
This results in the actual window being pushed 2 pixels down and 2 pixels to the side.
It might be easier to see by configuring a very wide border (e.g. by executing bspc config border_width 20).

I tried removing borders by disabling decorations [2] but that didn't have any visible effect in bspwm (that configuration does remove borders/titlebar in i3wm).
Manually disabling borders via bspc does work though (both bspc config border_width 0 and bspc rule -a Nightly:Toolkit border=off fix the PiP window placement).

(In reply to Danny Colin [:sdk] on comment #10 of bug 1532096)

It doesn't have a border on bspwm where this issue happens. I've opened 1587869.

The above description does make sense to me but, of course, I might be wrong.
Could you verify if changing the border configuration (via bspc) makes any difference for you as well?

[1] https://github.com/baskerville/bspwm/blob/master/examples/bspwmrc
[2] https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-decorated

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(contact)
OS: Unspecified → Linux
Priority: -- → P3

(In reply to Dennis van der Schagt [:dennisschagt] from comment #1)

Could you verify if changing the border configuration (via bspc) makes any difference for you as well?

Yes. If I set a bigger border it pushes it further down and removing the border resolve the issue.
However, I lost the ability to know if PiP window is focused or not.

Flags: needinfo?(contact)
No longer blocks: 1532677
Component: Video/Audio Controls → Picture-in-Picture
Version: 71 Branch → Trunk

I also tried on Qtile and Gnome Shell and the issue is also there. It seems like the window border isn't taken into consideration when positioning the PiP window. For example, if the window border is 2px then the window will be positioned 2px offscreen hiding the right side border.

Hardware: Unspecified → Desktop
Summary: Picture in Picture window is misaligned/partly outside the screen on bspwm → Picture in Picture window is misaligned/partly outside the screen on Linux

I am unsure how to verify if this issue is still reproducing or not considering the 1 or 2 pixels frame that is supposedly spilling out, but I will lower the severity to S4.
Furthermore, this issue only occurs on Ubuntu 20 and no longer occurs on Ubuntu 21/22 since firefox browsers are opened with the Wayland Window Protocol and another issue occurs there (related to position): bug 1757918.

Severity: normal → S4

I can still reproduce it if there's a window decoration (aka border) around the PiP window. If you need more info, feel free to ping me on matrix @dannycolin:mozilla.org

Priority: P3 → P4
Summary: Picture in Picture window is misaligned/partly outside the screen on Linux → Picture in Picture window is misaligned, 1-2 pixels outside the screen on non-wayland Linux
Whiteboard: [fidefe-MR1-2022]
You need to log in before you can comment on or make changes to this bug.