Skip to content
Snippets Groups Projects
Commit f238b9d8 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Sébastien Blin
Browse files

x11: window sharing

GitLab: jami-project#1294

Change-Id: I6dfaea6c65323d072536518f3ac7abc426d33efd
parent 3fe379ca
No related branches found
No related tags found
No related merge requests found
...@@ -239,6 +239,60 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig ...@@ -239,6 +239,60 @@ AvAdapter::shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned heig
#endif #endif
} }
void
AvAdapter::shareWindow(const QString& windowId)
{
auto resource = lrcInstance_->getCurrentCallModel()->getDisplay(windowId);
auto callId = lrcInstance_->getCurrentCallId();
lrcInstance_->getCurrentCallModel()
->requestMediaChange(callId,
"video_0",
resource,
lrc::api::NewCallModel::MediaRequestType::SCREENSHARING,
false);
set_currentRenderingDeviceType(
lrcInstance_->getCurrentCallModel()->getCurrentRenderedDevice(callId).type);
}
QString
AvAdapter::getSharingResource(int screenId = -2, const QString& windowId = "")
{
if (screenId == -1) {
const auto arrangementRect = getAllScreensBoundingRect();
return lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
arrangementRect.x(),
arrangementRect.y(),
arrangementRect.width(),
arrangementRect.height());
} else if (screenId > -1) {
QScreen* screen = QGuiApplication::screens().at(screenId);
if (!screen)
return "";
QRect rect = screen->geometry();
return lrcInstance_->getCurrentCallModel()->getDisplay(getScreenNumber(),
rect.x(),
rect.y(),
rect.width()
* screen->devicePixelRatio(),
rect.height()
* screen->devicePixelRatio());
} else if (!windowId.isEmpty()) {
return lrcInstance_->getCurrentCallModel()->getDisplay(windowId);
}
return "";
}
void
AvAdapter::getListWindows()
{
auto map = lrcInstance_->avModel().getListWindows();
set_windowsNames(map.keys());
set_windowsIds(map.values());
}
void void
AvAdapter::stopSharing() AvAdapter::stopSharing()
{ {
......
...@@ -31,6 +31,8 @@ class AvAdapter final : public QmlAdapterBase ...@@ -31,6 +31,8 @@ class AvAdapter final : public QmlAdapterBase
Q_OBJECT Q_OBJECT
QML_RO_PROPERTY(lrc::api::video::DeviceType, currentRenderingDeviceType) QML_RO_PROPERTY(lrc::api::video::DeviceType, currentRenderingDeviceType)
QML_PROPERTY(bool, muteCamera) QML_PROPERTY(bool, muteCamera)
QML_RO_PROPERTY(QStringList, windowsNames)
QML_RO_PROPERTY(QList<QVariant>, windowsIds)
public: public:
explicit AvAdapter(LRCInstance* instance, QObject* parent = nullptr); explicit AvAdapter(LRCInstance* instance, QObject* parent = nullptr);
...@@ -62,6 +64,14 @@ protected: ...@@ -62,6 +64,14 @@ protected:
// Select screen area to display (from all screens). // Select screen area to display (from all screens).
Q_INVOKABLE void shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned height); Q_INVOKABLE void shareScreenArea(unsigned x, unsigned y, unsigned width, unsigned height);
// Select window to display.
Q_INVOKABLE void shareWindow(const QString& windowId);
// Returns the screensharing resource
Q_INVOKABLE QString getSharingResource(int screenId, const QString& key);
Q_INVOKABLE void getListWindows();
// Stop sharing the screen or file // Stop sharing the screen or file
Q_INVOKABLE void stopSharing(); Q_INVOKABLE void stopSharing();
......
...@@ -495,6 +495,9 @@ Item { ...@@ -495,6 +495,9 @@ Item {
// SelectScreen // SelectScreen
property string selectScreen: qsTr("Select a screen to share") property string selectScreen: qsTr("Select a screen to share")
property string allScreens: qsTr("All Screens")
property string screens: qsTr("Screens")
property string windows: qsTr("Windows")
// UserProfile // UserProfile
property string qrCode: qsTr("QR code") property string qrCode: qsTr("QR code")
......
...@@ -132,7 +132,7 @@ Item { ...@@ -132,7 +132,7 @@ Item {
property color recordIconColor: "#dc2719" property color recordIconColor: "#dc2719"
property color successLabelColor: "#2b5084" property color successLabelColor: "#2b5084"
property color rubberBandSelectionBlue: "steelblue" property color rubberBandSelectionBlue: "steelblue"
property color screenSelectionBorderGreen: "green" property color screenSelectionBorderColor: raiseHandColor
property color separationLine: darkTheme ? selectedColor : backgroundColor property color separationLine: darkTheme ? selectedColor : backgroundColor
// Plugin Preferences View // Plugin Preferences View
......
...@@ -184,12 +184,7 @@ Control { ...@@ -184,12 +184,7 @@ Control {
}, },
Action { Action {
id: muteVideoAction id: muteVideoAction
onTriggered: { onTriggered: CallAdapter.videoPauseThisCallToggle(!isVideoMuted)
if (AvAdapter.currentRenderingDeviceType === Video.DeviceType.DISPLAY || AvAdapter.currentRenderingDeviceType === Video.DeviceType.FILE) {
AvAdapter.stopSharing()
} else
CallAdapter.videoPauseThisCallToggle(!isVideoMuted)
}
checkable: true checkable: true
icon.source: checked ? icon.source: checked ?
JamiResources.videocam_off_24dp_svg : JamiResources.videocam_off_24dp_svg :
......
...@@ -169,11 +169,12 @@ Item { ...@@ -169,11 +169,12 @@ Item {
if (AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY && AvAdapter.currentRenderingDeviceType !== Video.DeviceType.FILE) { if (AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY && AvAdapter.currentRenderingDeviceType !== Video.DeviceType.FILE) {
AvAdapter.muteCamera = root.isVideoMuted AvAdapter.muteCamera = root.isVideoMuted
} }
if (Qt.application.screens.length === 1) { AvAdapter.getListWindows()
if (Qt.application.screens.length + AvAdapter.windowsNames.length === 1) {
AvAdapter.shareEntireScreen(0) AvAdapter.shareEntireScreen(0)
} else { } else {
SelectScreenWindowCreation.createSelectScreenWindowObject() SelectScreenWindowCreation.createSelectScreenWindowObject()
SelectScreenWindowCreation.showSelectScreenWindow() SelectScreenWindowCreation.showSelectScreenWindow(callPreviewId)
} }
} }
......
...@@ -119,11 +119,12 @@ ContextMenuAutoLoader { ...@@ -119,11 +119,12 @@ ContextMenuAutoLoader {
if (AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY && AvAdapter.currentRenderingDeviceType !== Video.DeviceType.FILE) { if (AvAdapter.currentRenderingDeviceType !== Video.DeviceType.DISPLAY && AvAdapter.currentRenderingDeviceType !== Video.DeviceType.FILE) {
AvAdapter.muteCamera = root.isVideoMuted AvAdapter.muteCamera = root.isVideoMuted
} }
if (Qt.application.screens.length === 1) { AvAdapter.getListWindows()
if (Qt.application.screens.length + AvAdapter.windowsNames().length === 1) {
AvAdapter.shareEntireScreen(0) AvAdapter.shareEntireScreen(0)
} else { } else {
SelectScreenWindowCreation.createSelectScreenWindowObject() SelectScreenWindowCreation.createSelectScreenWindowObject()
SelectScreenWindowCreation.showSelectScreenWindow() SelectScreenWindowCreation.showSelectScreenWindow(callPreviewId)
} }
} }
}, },
......
/* /*
* Copyright (C) 2020 by Savoir-faire Linux * Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com> * Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
* Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -31,25 +32,42 @@ import "../../commoncomponents" ...@@ -31,25 +32,42 @@ import "../../commoncomponents"
// is to make user aware of which screen they want to share, // is to make user aware of which screen they want to share,
// during the video call, if the context menu item is selected. // during the video call, if the context menu item is selected.
Window { Window {
id: selectScreenWindow id: root
property int minWidth: 650 property int minWidth: 650
property int minHeight: 500 property int minHeight: 500
property int selectedScreenNumber: -1 property int selectedScreenNumber: -1
property bool selectAllScreens: false property bool selectAllScreens: false
property string currentPreview: ""
property var screens: []
// How many rows the ScrollView should have. // How many rows the ScrollView should have.
function calculateRepeaterModel() { function calculateRepeaterModel() {
var numberOfScreens = Qt.application.screens.length screens = []
for (var idx in Qt.application.screens) {
screens.push(qsTr("Screen") + " " + idx)
}
AvAdapter.getListWindows()
for (var idx in AvAdapter.windowsNames) {
screens.push(AvAdapter.windowsNames[idx])
}
return Math.ceil(numberOfScreens / 2) return screens.length
} }
function calculateScreenNumber(index, isEven) { onActiveChanged: {
return index * 2 + (isEven ? 2 : 1) if (!active) {
selectedScreenNumber = -1
selectAllScreens = false
}
screenInfo.model = {}
screenInfo2.model = {}
calculateRepeaterModel()
screenInfo.model = screens.length
screenInfo2.model = screens.length
windowsText.visible = screens.length > Qt.application.screens.length
} }
minimumWidth: minWidth minimumWidth: minWidth
minimumHeight: minHeight minimumHeight: minHeight
...@@ -60,6 +78,8 @@ Window { ...@@ -60,6 +78,8 @@ Window {
modality: Qt.ApplicationModal modality: Qt.ApplicationModal
title: JamiStrings.selectScreen
Rectangle { Rectangle {
id: selectScreenWindowRect id: selectScreenWindowRect
...@@ -67,204 +87,116 @@ Window { ...@@ -67,204 +87,116 @@ Window {
color: JamiTheme.backgroundColor color: JamiTheme.backgroundColor
Text {
id: screenListText
anchors.top: selectScreenWindowRect.top
anchors.topMargin: JamiTheme.preferredMarginSize
anchors.horizontalCenter: selectScreenWindowRect.horizontalCenter
font.pointSize: JamiTheme.textFontSize + 2
font.bold: true
text: JamiStrings.selectScreen
color: JamiTheme.textColor
}
ScrollView { ScrollView {
id: screenSelectionScrollView id: screenSelectionScrollView
anchors.top: screenListText.bottom
anchors.topMargin: JamiTheme.preferredMarginSize anchors.topMargin: JamiTheme.preferredMarginSize
anchors.horizontalCenter: selectScreenWindowRect.horizontalCenter anchors.horizontalCenter: selectScreenWindowRect.horizontalCenter
width: selectScreenWindowRect.width width: selectScreenWindowRect.width
height: selectScreenWindowRect.height - height: selectScreenWindowRect.height -
(screenListText.height + selectButton.height + JamiTheme.preferredMarginSize * 4) (selectButton.height + JamiTheme.preferredMarginSize * 4)
clip: true clip: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AlwaysOn ScrollBar.vertical.policy: ScrollBar.AlwaysOn
// Column of rows repeater (two screen captures in a row). Flow {
Column { id: screenSelectionScrollViewFlow
id: screenSelectionScrollViewColumn
spacing: 10
Repeater {
id: screenInfo
model: calculateRepeaterModel()
Row {
id: screenInfoRow
leftPadding: JamiTheme.preferredMarginSize
rightPadding: JamiTheme.preferredMarginSize
spacing: screenSelectionScrollViewColumn.spacing
Connections {
target: selectScreenWindow
function onSelectedScreenNumberChanged() {
// Recover from green state.
screenSelectionRectOdd.borderColor = JamiTheme.tabbarBorderColor
screenSelectionRectEven.borderColor = JamiTheme.tabbarBorderColor
}
}
Connections {
target: AvAdapter
function onScreenCaptured(screenNumber, source) { anchors.fill: parent
if (screenNumber === -1) topPadding: JamiTheme.preferredMarginSize
screenShotAll.source = JamiQmlUtils.base64StringTitle + source rightPadding: JamiTheme.preferredMarginSize
if (screenNumber !== index && screenNumber !== index + 1) leftPadding: JamiTheme.preferredMarginSize
return
if (screenNumber % 2 !== 1)
screenShotOdd.source = JamiQmlUtils.base64StringTitle + source
else
screenShotEven.source = JamiQmlUtils.base64StringTitle + source
}
}
// To make sure that two screen captures in one row, spacing: 10
// a repeater of two rect is needed, which one in charge
// of odd number screen, one in charge of even number screen.
Rectangle {
id: screenSelectionRectOdd
property string borderColor: JamiTheme.tabbarBorderColor Text {
width: screenSelectionScrollView.width
height: JamiTheme.preferredFieldHeight
color: JamiTheme.secondaryBackgroundColor font.pointSize: JamiTheme.menuFontSize
font.bold: true
text: JamiStrings.screens
verticalAlignment: Text.AlignBottom
color: JamiTheme.textColor
}
height: screenSelectionScrollView.height Repeater {
width: screenSelectionScrollView.width / 2 - id: screenInfo
screenInfoRow.spacing / 2 - JamiTheme.preferredMarginSize
border.color: borderColor model: screens ? screens.length : 0
Image { delegate: Rectangle {
id: screenShotOdd id: screenItem
anchors.top: screenSelectionRectOdd.top color: JamiTheme.secondaryBackgroundColor
anchors.topMargin: 10
anchors.horizontalCenter: screenSelectionRectOdd.horizontalCenter
height: screenSelectionRectOdd.height - 50 width: screenSelectionScrollView.width / 2 -
width: screenSelectionRectOdd.width - 50 screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
height: 3 * width / 4
fillMode: Image.PreserveAspectFit border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor
mipmap: true visible: JamiStrings.selectScreen !== screens[index] && index < Qt.application.screens.length
Component.onCompleted: AvAdapter.captureScreen( PreviewRenderer {
calculateScreenNumber(index, false) - 1) id: screenPreview
}
Text { anchors.top: screenItem.top
id: screenNameOdd anchors.topMargin: 10
anchors.horizontalCenter: screenItem.horizontalCenter
height: screenItem.height - 50
width: screenItem.width - 50
anchors.top: screenShotOdd.bottom lrcInstance: LRCInstance
anchors.topMargin: 10
anchors.horizontalCenter: screenSelectionRectOdd.horizontalCenter
font.pointSize: JamiTheme.textFontSize - 2 Component.onDestruction: {
text: qsTr("Screen") + " " + calculateScreenNumber(index, false) if (screenPreview.rendererId !== "" && screenPreview.rendererId !== currentPreview)
color: JamiTheme.textColor VideoDevices.stopDevice(screenPreview.rendererId, true)
} }
Component.onCompleted: {
MouseArea { if (visible) {
anchors.fill: parent var rendId = AvAdapter.getSharingResource(index, "")
acceptedButtons: Qt.LeftButton if (rendId !== "")
screenPreview.rendererId = VideoDevices.startDevice(rendId, true)
onClicked: {
if (selectedScreenNumber == -1
|| selectedScreenNumber !==
calculateScreenNumber(index, false)) {
selectedScreenNumber = calculateScreenNumber(index, false)
screenSelectionRectOdd.borderColor
= JamiTheme.screenSelectionBorderGreen
}
} }
} }
} }
Rectangle { Text {
id: screenSelectionRectEven id: screenName
property string borderColor: JamiTheme.tabbarBorderColor anchors.top: screenPreview.bottom
anchors.topMargin: 10
color: JamiTheme.secondaryBackgroundColor anchors.horizontalCenter: screenItem.horizontalCenter
width: parent.width
height: screenSelectionScrollView.height font.pointSize: JamiTheme.textFontSize
width: screenSelectionScrollView.width / 2 - text: screens[index] ? screens[index] : ""
screenInfoRow.spacing / 2 - JamiTheme.preferredMarginSize elide: Text.ElideMiddle
horizontalAlignment: Text.AlignHCenter
border.color: borderColor color: JamiTheme.textColor
}
visible: {
if (calculateScreenNumber(index, true) >=
Qt.application.screens.length)
return (Qt.application.screens.length) % 2 != 1
return true
}
Image {
id: screenShotEven
anchors.top: screenSelectionRectEven.top
anchors.topMargin: 10
anchors.horizontalCenter: screenSelectionRectEven.horizontalCenter
height: screenSelectionRectEven.height - 50
width: screenSelectionRectEven.width - 50
fillMode: Image.PreserveAspectFit MouseArea {
mipmap: true anchors.fill: screenItem
acceptedButtons: Qt.LeftButton
Component.onCompleted: { onClicked: {
if (screenSelectionRectEven.visible) selectAllScreens = false
AvAdapter.captureScreen( if (selectedScreenNumber == -1
calculateScreenNumber(index, true) - 1) || selectedScreenNumber !== index) {
selectedScreenNumber = index
} }
} }
}
Text { Connections {
id: screenNameEven target: AvAdapter
anchors.top: screenShotEven.bottom
anchors.topMargin: 10
anchors.horizontalCenter: screenSelectionRectEven.horizontalCenter
font.pointSize: JamiTheme.textFontSize - 2
text: qsTr("Screen") + " " + (calculateScreenNumber(index, true))
color: JamiTheme.textColor
}
MouseArea { function onScreenCaptured(screenNumber, source) {
anchors.fill: parent if (screenNumber === -1)
acceptedButtons: Qt.LeftButton screenShotAll.source = JamiQmlUtils.base64StringTitle + source
onClicked: {
if (selectedScreenNumber == -1
|| selectedScreenNumber !==
calculateScreenNumber(index, true)) {
selectedScreenNumber = calculateScreenNumber(index, true)
screenSelectionRectEven.borderColor
= JamiTheme.screenSelectionBorderGreen
}
}
} }
} }
} }
...@@ -273,41 +205,38 @@ Window { ...@@ -273,41 +205,38 @@ Window {
Rectangle { Rectangle {
id: screenSelectionRectAll id: screenSelectionRectAll
property string borderColor: JamiTheme.tabbarBorderColor
anchors.horizontalCenter: screenSelectionScrollViewColumn.horizontalCenter
color: JamiTheme.secondaryBackgroundColor color: JamiTheme.secondaryBackgroundColor
height: screenSelectionScrollView.height width: screenSelectionScrollView.width / 2 -
width: screenSelectionScrollView.width - 2 * JamiTheme.preferredMarginSize screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
height: 3 * width / 4
border.color: borderColor
Connections { border.color: selectAllScreens ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor
target: selectScreenWindow
function onSelectedScreenNumberChanged() { visible: Qt.application.screens.length > 1
// Recover from green state.
selectAllScreens = false
screenSelectionRectAll.borderColor = JamiTheme.tabbarBorderColor
}
}
Image { PreviewRenderer {
id: screenShotAll id: screenShotAll
anchors.top: screenSelectionRectAll.top anchors.top: screenSelectionRectAll.top
anchors.topMargin: 10 anchors.topMargin: 10
anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter
height: screenSelectionRectAll.height - 50 height: screenSelectionRectAll.height - 50
width: screenSelectionRectAll.width - 50 width: screenSelectionRectAll.width - 50
fillMode: Image.PreserveAspectFit lrcInstance: LRCInstance
mipmap: true
Component.onCompleted: AvAdapter.captureAllScreens() Component.onDestruction: {
if (screenShotAll.rendererId !== "" && screenShotAll.rendererId !== currentPreview)
VideoDevices.stopDevice(screenShotAll.rendererId, true)
}
Component.onCompleted: {
if (visible) {
var rendId = AvAdapter.getSharingResource(-1, "")
if (rendId !== "")
screenShotAll.rendererId = VideoDevices.startDevice(rendId, true)
}
}
} }
Text { Text {
...@@ -317,8 +246,8 @@ Window { ...@@ -317,8 +246,8 @@ Window {
anchors.topMargin: 10 anchors.topMargin: 10
anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter anchors.horizontalCenter: screenSelectionRectAll.horizontalCenter
font.pointSize: JamiTheme.textFontSize - 2 font.pointSize: JamiTheme.textFontSize
text: qsTr("All Screens") text: JamiStrings.allScreens
color: JamiTheme.textColor color: JamiTheme.textColor
} }
...@@ -329,8 +258,90 @@ Window { ...@@ -329,8 +258,90 @@ Window {
onClicked: { onClicked: {
selectedScreenNumber = -1 selectedScreenNumber = -1
selectAllScreens = true selectAllScreens = true
screenSelectionRectAll.borderColor }
= JamiTheme.screenSelectionBorderGreen }
}
Text {
id: windowsText
width: screenSelectionScrollView.width
height: JamiTheme.preferredFieldHeight
font.pointSize: JamiTheme.menuFontSize
font.bold: true
text: JamiStrings.windows
verticalAlignment: Text.AlignBottom
color: JamiTheme.textColor
}
Repeater {
id: screenInfo2
model: screens ? screens.length : 0
delegate: Rectangle {
id: screenItem2
color: JamiTheme.secondaryBackgroundColor
width: screenSelectionScrollView.width / 2 -
screenSelectionScrollViewFlow.spacing / 2 - JamiTheme.preferredMarginSize
height: 3 * width / 4
border.color: selectedScreenNumber === index ? JamiTheme.screenSelectionBorderColor : JamiTheme.tabbarBorderColor
visible: JamiStrings.selectScreen !== screens[index] && index >= Qt.application.screens.length
PreviewRenderer {
id: screenPreview2
anchors.top: screenItem2.top
anchors.topMargin: 10
anchors.horizontalCenter: screenItem2.horizontalCenter
anchors.leftMargin: 25
anchors.rightMargin: 25
height: screenItem2.height - 60
width: screenItem2.width - 50
lrcInstance: LRCInstance
Component.onDestruction: {
if (screenPreview2.rendererId !== "" && screenPreview2.rendererId !== currentPreview)
VideoDevices.stopDevice(screenPreview2.rendererId, true)
}
Component.onCompleted: {
if (visible) {
var rendId = AvAdapter.getSharingResource(-2, AvAdapter.windowsIds[index - Qt.application.screens.length])
if (rendId !== "")
screenPreview2.rendererId = VideoDevices.startDevice(rendId, true)
}
}
}
Text {
id: screenName2
anchors.top: screenPreview2.bottom
anchors.topMargin: 10
anchors.horizontalCenter: screenItem2.horizontalCenter
width: parent.width
font.pointSize: JamiTheme.textFontSize
text: screens[index] ? screens[index] : ""
elide: Text.ElideMiddle
horizontalAlignment: Text.AlignHCenter
color: JamiTheme.textColor
}
MouseArea {
anchors.fill: screenItem2
acceptedButtons: Qt.LeftButton
onClicked: {
selectAllScreens = false
if (selectedScreenNumber == -1
|| selectedScreenNumber !== index) {
selectedScreenNumber = index
}
}
} }
} }
} }
...@@ -347,22 +358,27 @@ Window { ...@@ -347,22 +358,27 @@ Window {
preferredWidth: 200 preferredWidth: 200
visible: selectedScreenNumber != -1 || selectAllScreens enabled: selectedScreenNumber != -1 || selectAllScreens
opacity: enabled ? 1.0 : 0.5
color: JamiTheme.buttonTintedBlack color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true outlined: true
enabled: true
text: JamiStrings.shareScreen text: JamiStrings.shareScreen
onClicked: { onClicked: {
if (selectAllScreens) if (selectAllScreens)
AvAdapter.shareAllScreens() AvAdapter.shareAllScreens()
else else {
AvAdapter.shareEntireScreen(selectedScreenNumber - 1) if (selectedScreenNumber < Qt.application.screens.length)
selectScreenWindow.close() AvAdapter.shareEntireScreen(selectedScreenNumber)
else {
AvAdapter.shareWindow(AvAdapter.windowsIds[selectedScreenNumber - Qt.application.screens.length])
}
}
root.close()
} }
} }
} }
...@@ -43,7 +43,9 @@ function finishCreation() { ...@@ -43,7 +43,9 @@ function finishCreation() {
selectScreenWindowObject.onClosing.connect(destroySelectScreenWindow) selectScreenWindowObject.onClosing.connect(destroySelectScreenWindow)
} }
function showSelectScreenWindow() { function showSelectScreenWindow(previewId) {
console.log("previewId", previewId)
selectScreenWindowObject.currentPreview = previewId
selectScreenWindowObject.show() selectScreenWindowObject.show()
var screen = selectScreenWindowObject.screen var screen = selectScreenWindowObject.screen
......
...@@ -290,7 +290,6 @@ VideoDevices::getDefaultDevice() ...@@ -290,7 +290,6 @@ VideoDevices::getDefaultDevice()
return rendererId; return rendererId;
} }
#pragma optimize("", off)
QString QString
VideoDevices::startDevice(const QString& deviceId, bool force) VideoDevices::startDevice(const QString& deviceId, bool force)
{ {
...@@ -310,7 +309,6 @@ VideoDevices::stopDevice(const QString& deviceId, bool force) ...@@ -310,7 +309,6 @@ VideoDevices::stopDevice(const QString& deviceId, bool force)
deviceOpen_ = false; deviceOpen_ = false;
} }
} }
#pragma optimize("", on)
void void
VideoDevices::setDefaultDeviceRes(int index) VideoDevices::setDefaultDeviceRes(int index)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment