[gnome-remote-desktop] settings: Add new screenshare mode setting for the RDP backend
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] settings: Add new screenshare mode setting for the RDP backend
- Date: Fri, 25 Feb 2022 17:00:15 +0000 (UTC)
commit f267ca08f04749d26388b4b49e13c99bd94851b8
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Wed Nov 24 08:55:11 2021 +0100
settings: Add new screenshare mode setting for the RDP backend
Implementing support for virtual monitors should be done without
regressions.
By default, gnome-remote-desktop currently mirrors the primary monitor.
For now, this behaviour should be preserved.
In order to be able to use virtual monitor in a remote desktop session,
a switch is needed.
So, add a new gsetting, which allows choosing between remote desktop
sessions, where the primary monitor is recorded and remote desktop
sessions, which create and use a virtual monitor.
The latter also allows the usage of gnome-remote-desktop, when no
physical monitors are attached.
src/grd-enums.h | 6 +++++
src/grd-settings.c | 29 ++++++++++++++++++++++
src/grd-settings.h | 2 ++
...org.gnome.desktop.remote-desktop.gschema.xml.in | 27 ++++++++++++++++++++
4 files changed, 64 insertions(+)
---
diff --git a/src/grd-enums.h b/src/grd-enums.h
index ffab8212..e3ecc404 100644
--- a/src/grd-enums.h
+++ b/src/grd-enums.h
@@ -21,6 +21,12 @@
#ifndef GRD_ENUMS_H
#define GRD_ENUMS_H
+typedef enum
+{
+ GRD_RDP_SCREEN_SHARE_MODE_MIRROR_PRIMARY,
+ GRD_RDP_SCREEN_SHARE_MODE_EXTEND,
+} GrdRdpScreenShareMode;
+
typedef enum
{
GRD_VNC_AUTH_METHOD_PROMPT,
diff --git a/src/grd-settings.c b/src/grd-settings.c
index 4560a375..6d0d157f 100644
--- a/src/grd-settings.c
+++ b/src/grd-settings.c
@@ -32,6 +32,7 @@
enum
{
+ RDP_SCREEN_SHARE_MODE_CHANGED,
RDP_SERVER_CERT_CHANGED,
RDP_SERVER_KEY_CHANGED,
RDP_VIEW_ONLY_CHANGED,
@@ -50,6 +51,8 @@ struct _GrdSettings
struct {
GSettings *settings;
+
+ GrdRdpScreenShareMode screen_share_mode;
char *server_cert;
char *server_key;
gboolean view_only;
@@ -121,6 +124,12 @@ grd_settings_override_vnc_port (GrdSettings *settings,
settings->vnc.port = port;
}
+GrdRdpScreenShareMode
+grd_settings_get_screen_share_mode (GrdSettings *settings)
+{
+ return settings->rdp.screen_share_mode;
+}
+
char *
grd_settings_get_rdp_server_cert (GrdSettings *settings)
{
@@ -248,6 +257,13 @@ grd_settings_get_vnc_auth_method (GrdSettings *settings)
return settings->vnc.auth_method;
}
+static void
+update_screen_share_mode (GrdSettings *settings)
+{
+ settings->rdp.screen_share_mode =
+ g_settings_get_enum (settings->rdp.settings, "screen-share-mode");
+}
+
static void
update_rdp_tls_cert (GrdSettings *settings)
{
@@ -290,6 +306,11 @@ on_rdp_settings_changed (GSettings *rdp_settings,
const char *key,
GrdSettings *settings)
{
+ if (strcmp (key, "screen-share-mode") == 0)
+ {
+ update_screen_share_mode (settings);
+ g_signal_emit (settings, signals[RDP_SCREEN_SHARE_MODE_CHANGED], 0);
+ }
if (strcmp (key, "tls-cert") == 0)
{
update_rdp_tls_cert (settings);
@@ -348,6 +369,7 @@ grd_settings_init (GrdSettings *settings)
g_signal_connect (settings->vnc.settings, "changed",
G_CALLBACK (on_vnc_settings_changed), settings);
+ update_screen_share_mode (settings);
update_rdp_tls_cert (settings);
update_rdp_tls_key (settings);
update_rdp_view_only (settings);
@@ -365,6 +387,13 @@ grd_settings_class_init (GrdSettingsClass *klass)
object_class->finalize = grd_settings_finalize;
+ signals[RDP_SCREEN_SHARE_MODE_CHANGED] =
+ g_signal_new ("rdp-screen-share-mode-changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
signals[RDP_SERVER_CERT_CHANGED] =
g_signal_new ("rdp-tls-cert-changed",
G_TYPE_FROM_CLASS (klass),
diff --git a/src/grd-settings.h b/src/grd-settings.h
index e12e47ed..528167fa 100644
--- a/src/grd-settings.h
+++ b/src/grd-settings.h
@@ -45,6 +45,8 @@ void grd_settings_override_rdp_port (GrdSettings *settings,
void grd_settings_override_vnc_port (GrdSettings *settings,
int port);
+GrdRdpScreenShareMode grd_settings_get_screen_share_mode (GrdSettings *settings);
+
char * grd_settings_get_rdp_server_cert (GrdSettings *settings);
char * grd_settings_get_rdp_server_key (GrdSettings *settings);
diff --git a/src/org.gnome.desktop.remote-desktop.gschema.xml.in
b/src/org.gnome.desktop.remote-desktop.gschema.xml.in
index 0779c8c6..e61e6bc5 100644
--- a/src/org.gnome.desktop.remote-desktop.gschema.xml.in
+++ b/src/org.gnome.desktop.remote-desktop.gschema.xml.in
@@ -2,6 +2,33 @@
<schema id='org.gnome.desktop.remote-desktop' path='/org/gnome/desktop/remote-desktop/'>
</schema>
<schema id='org.gnome.desktop.remote-desktop.rdp' path='/org/gnome/desktop/remote-desktop/rdp/'>
+ <key name='screen-share-mode' enum='org.gnome.desktop.remote-desktop.GrdRdpScreenShareMode'>
+ <default>'mirror-primary'</default>
+ <summary>Screenshare mode of RDP connections</summary>
+ <description>
+ The screenshare mode specifies, whether the RDP backend mirrors the
+ primary screen, or whether a virtual monitor is created.
+
+ For the initial resolution of the virtual monitor, the RDP backend uses
+ either the client core data ([MS-RDPBCGR] 2.2.1.3.2) or the client
+ monitor data ([MS-RDPBCGR] 2.2.1.3.6), depending on what is available.
+
+ When using a remote desktop session with a virtual monitor, clients can
+ resize the resolution of the virtual monitor during a session with the
+ Display Control Channel Extension ([MS-RDPEDISP]).
+
+ Allowed screenshare modes include:
+
+ * mirror-primary - Record the primary monitor of the current user
+ session.
+
+ * extend - Create a new virtual monitor and use it for the remote
+ desktop session.
+ The resolution of this virtual monitor is derived from the
+ monitor configuration, submitted by the remote desktop
+ client.
+ </description>
+ </key>
<key name='tls-cert' type='s'>
<default>''</default>
<summary>Path to the certificate file</summary>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]