зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1675764 [Wayland] Don't use screen sharing preview with PipeWire, r=jib
When screen sharing preview is generated a system dialog is fired and the same system dialog is fired again when an actual sharing is performed. Shared resource is selected by system dialog only, we don't have any control which system resource will be shared over PipeWire. So there's no point to generate a preview of a resource which may not be shared as an user can select a different resorce. The preview should be generated by system dialog where the shared resource is selected and confirmed, we only consume that user selection. Depends on D96694 Differential Revision: https://phabricator.services.mozilla.com/D96806
This commit is contained in:
Родитель
f11f528e9f
Коммит
1a6364a456
|
@ -761,6 +761,8 @@ function prompt(aActor, aBrowser, aRequest) {
|
||||||
);
|
);
|
||||||
menupopup.appendChild(doc.createXULElement("menuseparator"));
|
menupopup.appendChild(doc.createXULElement("menuseparator"));
|
||||||
|
|
||||||
|
let isPipeWire = false;
|
||||||
|
|
||||||
// Build the list of 'devices'.
|
// Build the list of 'devices'.
|
||||||
let monitorIndex = 1;
|
let monitorIndex = 1;
|
||||||
for (let i = 0; i < devices.length; ++i) {
|
for (let i = 0; i < devices.length; ++i) {
|
||||||
|
@ -788,6 +790,7 @@ function prompt(aActor, aBrowser, aRequest) {
|
||||||
// Don't mark it as scary as there's an extra confirmation step by
|
// Don't mark it as scary as there's an extra confirmation step by
|
||||||
// PipeWire portal dialog.
|
// PipeWire portal dialog.
|
||||||
if (name == PIPEWIRE_PORTAL_NAME && device.id == PIPEWIRE_ID) {
|
if (name == PIPEWIRE_PORTAL_NAME && device.id == PIPEWIRE_ID) {
|
||||||
|
isPipeWire = true;
|
||||||
let sawcStringId = "getUserMedia.sharePipeWirePortal.label";
|
let sawcStringId = "getUserMedia.sharePipeWirePortal.label";
|
||||||
let item = addDeviceToList(
|
let item = addDeviceToList(
|
||||||
menupopup,
|
menupopup,
|
||||||
|
@ -913,6 +916,7 @@ function prompt(aActor, aBrowser, aRequest) {
|
||||||
perms.EXPIRE_SESSION
|
perms.EXPIRE_SESSION
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!isPipeWire) {
|
||||||
video.deviceId = deviceId;
|
video.deviceId = deviceId;
|
||||||
let constraints = {
|
let constraints = {
|
||||||
video: { mediaSource: type, deviceId: { exact: deviceId } },
|
video: { mediaSource: type, deviceId: { exact: deviceId } },
|
||||||
|
@ -946,6 +950,7 @@ function prompt(aActor, aBrowser, aRequest) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
menupopup.addEventListener("command", menupopup._commandEventListener);
|
menupopup.addEventListener("command", menupopup._commandEventListener);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче