Closed Bug 1817263 Opened 2 years ago Closed 2 years ago

Display capture under Wayland should use a unified picker for any type of capture

Categories

(Core :: WebRTC, defect, P2)

defect

Tracking

()

VERIFIED FIXED
112 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox110 --- unaffected
firefox111 --- verified
firefox112 --- verified

People

(Reporter: ng, Assigned: jgrulich)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

(From original bug)

Bug 1811341 - fix OS picker behavior under Wayland

Recent WebRTC backports and changes that are about to be backported from
upstream to Firefox breaks and will break how we work with PipWire based
desktop capturer. Currently when constructing device list, a fallback to
ScreenCapturerX11 is used, as we don't call set_allow_pipewire(), which
wouldn't make a difference anyway. In such case the only thing we need
is a placeholder for a screen that will request OS level prompt. We also
need a way to request both screens and windows in one xdg-desktop-portal
call as recent WebRTC made each type be called separately, therefore the
introduction of GenericCapturer. Lastly we need to make sure when there
is a MediaDevice requesting the OS prompt, that it will be checked as
first.

Recent WebRTC backports and changes that are about to be backported from
upstream to Firefox breaks and will break how we work with PipWire based
desktop capturer. Currently when constructing device list, a fallback to
ScreenCapturerX11 is used, as we don't call set_allow_pipewire(), which
wouldn't make a difference anyway. In such case the only thing we need
is a placeholder for a screen that will request OS level prompt. We also
need a way to request both screens and windows in one xdg-desktop-portal
call as recent WebRTC made each type be called separately, therefore the
introduction of GenericCapturer. Lastly we need to make sure when there
is a MediaDevice requesting the OS prompt, that it will be checked as
first.

In order to use unmodified libwebrtc, Firefox would need to rework the
OS picker to request each type (screens and windows) separately so we
can just use regular ScreenCapturer and WindowCapturer. This should be
done ideally the way Chromium does it, where users can actually see
even the preview of what they picked over xdg-desktop-portal before it
is actually shared with requesting web page and they also have option
to make the request again in case they picked a wrong window or screen.

Set release status flags based on info from the regressing bug 1811341

Once landed, I would like to nominate this for Beta uplift.

Duplicate of this bug: 1816604
Severity: -- → S2
Priority: -- → P2

Is this a dupe of bug 1817446?

Flags: needinfo?(na-g)
Duplicate of this bug: 1817446
Attachment #9318221 - Attachment description: Bug 1817263 - fix OS picker behavior under Wayland → WIP: Bug 1817263 - fix OS picker behavior under Wayland
Attachment #9318221 - Attachment description: WIP: Bug 1817263 - fix OS picker behavior under Wayland → Bug 1817263 - fix OS picker behavior under Wayland
Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/acd626664295 fix OS picker behavior under Wayland r=ng,jib,stransky
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Flags: needinfo?(na-g)

The patch landed in nightly and beta is affected.
:grulja, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox111 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(grulja)

Beta/Release Uplift Approval Request

  • User impact if declined: Users will not be able to share application windows, or potentially anything when XWayland is not running. Also they were hit by two xdg-desktop-portal dialogs, which is quite annoying issue.
  • 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: Try to share a screen on Wayland. You should get presented with "Use operating system settings" option only in the picker and you should not see "Screen x" or anything else. Also upon confirmation you should get a dialog where you can share either a screen or a window, while previously only screens were possible and you shouldn't get the same dialog again once you pick something in the xdg-desktop-portal-dialog.
  • List of other uplifts needed: n/a
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This change introduces a slightly different behavior specifically for Wayland screen sharing when PipeWire is used and doesn't affect anything else.
  • String changes made/needed: No
Flags: needinfo?(grulja)

Comment on attachment 9318221 [details]
Bug 1817263 - fix OS picker behavior under Wayland

Adding approval request on the attachment so it appears in relman uplift queries
See Comment 11

Attachment #9318221 - Flags: approval-mozilla-beta?

Comment on attachment 9318221 [details]
Bug 1817263 - fix OS picker behavior under Wayland

Approved for 111.0b6

Attachment #9318221 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

I was able to reproduce the issue on Firefox 112.0a1 (2023-02-16) on Ubuntu 22.04 Wayland where multiple prompts were shown initially.

The issue is fixed on Firefox 111.0b6 and Firefox 112.0a1 (2023-02-26) and only one prompt is shown from Firefox then the xdg one and the screenshare starts. Tests were performed on the same Ubuntu 22.04 Wayland system.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
Regressions: 1819044
Duplicate of this bug: 1819571

This was a change we introduced for Firefox and we didn't backport it to
WebRTC, however, it has been now requested also by Electron so this API
additon is now also part of WebRTC with just minor changes. This change
makes it on par with the WebRTC version so the next time we do WebRTC
rebase, we don't need to cherry-pick it and resolve conflicts.

WebRTC change: 0e9556a90cec52c2375c9250269f3abc21e8ca0c

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: