summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorDavid Elsing <david.elsing@posteo.net>2023-03-11 14:36:51 +0100
committerDavid Elsing <david.elsing@posteo.net>2023-03-30 17:36:40 +0200
commit1ba6a4d78d27181847bb1fd45838a70ae0c853e5 (patch)
treef911f0a647f116adb4ff6be2439b395b4d098034 /resources/qml
parentTranslated using Weblate (Turkish) (diff)
downloadnheko-1ba6a4d78d27181847bb1fd45838a70ae0c853e5.tar.xz
Support screen sharing with xdg-desktop-portal
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/voip/PlaceCall.qml1
-rw-r--r--resources/qml/voip/ScreenShare.qml56
2 files changed, 56 insertions, 1 deletions
diff --git a/resources/qml/voip/PlaceCall.qml b/resources/qml/voip/PlaceCall.qml
index a6dd99d8..c7a64342 100644
--- a/resources/qml/voip/PlaceCall.qml
+++ b/resources/qml/voip/PlaceCall.qml
@@ -103,7 +103,6 @@ Popup {
             }
 
             Button {
-                visible: CallManager.screenShareSupported
                 text: qsTr("Screen")
                 icon.source: "qrc:/icons/icons/ui/screen-share.svg"
                 onClicked: {
diff --git a/resources/qml/voip/ScreenShare.qml b/resources/qml/voip/ScreenShare.qml
index 2859eac4..80ea75d2 100644
--- a/resources/qml/voip/ScreenShare.qml
+++ b/resources/qml/voip/ScreenShare.qml
@@ -14,8 +14,15 @@ Popup {
     anchors.centerIn: parent;
 
     Component.onCompleted: {
+        if (CallManager.screenShareX11Available)
+            CallManager.setScreenShareType(ScreenShareType.X11);
+        else
+            CallManager.setScreenShareType(ScreenShareType.XDP);
         frameRateCombo.currentIndex = frameRateCombo.find(Settings.screenShareFrameRate);
     }
+    Component.onDestruction: {
+        CallManager.closeScreenShare();
+    }
     palette: Nheko.colors
 
     ColumnLayout {
@@ -35,18 +42,65 @@ Popup {
             Layout.bottomMargin: 8
 
             Label {
+            Layout.alignment: Qt.AlignLeft
+            text: qsTr("Method:")
+            color: Nheko.colors.windowText
+            }
+
+            RadioButton {
+            id: screenshare_X11
+            text: qsTr("X11");
+            visible: CallManager.screenShareX11Available
+            checked: CallManager.screenShareX11Available
+            onToggled: {
+                if (screenshare_X11.checked)
+                    CallManager.setScreenShareType(ScreenShareType.X11);
+                else
+                    CallManager.setScreenShareType(ScreenShareType.XDP);
+                }
+            }
+            RadioButton {
+            id: screenshare_XDP
+            text: qsTr("xdg-desktop-portal");
+            checked: !CallManager.screenShareX11Available
+            onToggled: {
+                if (screenshare_XDP.checked)
+                    CallManager.setScreenShareType(ScreenShareType.XDP);
+                else
+                    CallManager.setScreenShareType(ScreenShareType.X11);
+                }
+            }
+        }
+
+        RowLayout {
+            Layout.leftMargin: 8
+            Layout.rightMargin: 8
+            Layout.bottomMargin: 8
+
+            Label {
                 Layout.alignment: Qt.AlignLeft
                 text: qsTr("Window:")
                 color: Nheko.colors.windowText
             }
 
             ComboBox {
+                visible: screenshare_X11.checked
                 id: windowCombo
 
                 Layout.fillWidth: true
                 model: CallManager.windowList()
             }
 
+            Button {
+                visible: screenshare_XDP.checked
+                highlighted: !CallManager.screenShareReady
+                text: qsTr("Request screencast")
+                onClicked: {
+                  Settings.screenShareHideCursor = hideCursorCheckBox.checked;
+                  CallManager.setupScreenShareXDP();
+                }
+            }
+
         }
 
         RowLayout {
@@ -122,6 +176,7 @@ Popup {
             }
 
             Button {
+                visible: CallManager.screenShareReady
                 text: qsTr("Share")
                 icon.source: "qrc:/icons/icons/ui/screen-share.svg"
 
@@ -137,6 +192,7 @@ Popup {
             }
 
             Button {
+                visible: CallManager.screenShareReady
                 text: qsTr("Preview")
                 onClicked: {
                     CallManager.previewWindow(windowCombo.currentIndex);