[gnome-remote-desktop] settings: Add new screenshare mode setting for the VNC 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 VNC backend
- Date: Thu, 28 Jul 2022 08:38:51 +0000 (UTC)
commit a7d80c4466026667f928cb77e1fb79f82b5386a1
Author: Vasilis Liaskovitis <vliaskovitis suse com>
Date: Thu Jul 14 20:27:04 2022 +0200
settings: Add new screenshare mode setting for the VNC backend
By default, gnome-remote-desktop currently mirrors the primary monitor.
Similarly to RDP, 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.
Based on RDP virtual monitor commits by Pascal Nowack <Pascal Nowack gmx de>
https://gitlab.gnome.org/GNOME/gnome-remote-desktop/-/merge_requests/69
src/grd-enums.h | 6 +++++
src/grd-settings.c | 28 ++++++++++++++++++++++
src/grd-settings.h | 2 ++
...org.gnome.desktop.remote-desktop.gschema.xml.in | 26 ++++++++++++++++++++
4 files changed, 62 insertions(+)
---
diff --git a/src/grd-enums.h b/src/grd-enums.h
index e3ecc404..44b181d6 100644
--- a/src/grd-enums.h
+++ b/src/grd-enums.h
@@ -33,4 +33,10 @@ typedef enum
GRD_VNC_AUTH_METHOD_PASSWORD
} GrdVncAuthMethod;
+typedef enum
+{
+ GRD_VNC_SCREEN_SHARE_MODE_MIRROR_PRIMARY,
+ GRD_VNC_SCREEN_SHARE_MODE_EXTEND,
+} GrdVncScreenShareMode;
+
#endif /* GRD_ENUMS_H */
diff --git a/src/grd-settings.c b/src/grd-settings.c
index dad5d570..f8f34021 100644
--- a/src/grd-settings.c
+++ b/src/grd-settings.c
@@ -43,6 +43,7 @@ enum
VNC_VIEW_ONLY_CHANGED,
VNC_AUTH_METHOD_CHANGED,
VNC_ENCRYPTION_CHANGED,
+ VNC_SCREEN_SHARE_MODE_CHANGED,
N_SIGNALS
};
@@ -69,6 +70,7 @@ struct _GrdSettings
gboolean view_only;
GrdVncAuthMethod auth_method;
int port;
+ GrdVncScreenShareMode screen_share_mode;
} vnc;
};
@@ -106,6 +108,12 @@ grd_settings_get_screen_share_mode (GrdSettings *settings)
return settings->rdp.screen_share_mode;
}
+GrdVncScreenShareMode
+grd_settings_get_vnc_screen_share_mode (GrdSettings *settings)
+{
+ return settings->vnc.screen_share_mode;
+}
+
char *
grd_settings_get_rdp_server_cert (GrdSettings *settings)
{
@@ -266,6 +274,13 @@ update_screen_share_mode (GrdSettings *settings)
g_settings_get_enum (settings->rdp.settings, "screen-share-mode");
}
+static void
+update_vnc_screen_share_mode (GrdSettings *settings)
+{
+ settings->vnc.screen_share_mode =
+ g_settings_get_enum (settings->vnc.settings, "screen-share-mode");
+}
+
static void
update_rdp_enabled (GrdSettings *settings)
{
@@ -359,6 +374,11 @@ on_vnc_settings_changed (GSettings *vnc_settings,
update_vnc_enabled (settings);
g_signal_emit (settings, signals[VNC_ENABLED_CHANGED], 0);
}
+ else if (strcmp (key, "screen-share-mode") == 0)
+ {
+ update_vnc_screen_share_mode (settings);
+ g_signal_emit (settings, signals[VNC_SCREEN_SHARE_MODE_CHANGED], 0);
+ }
else if (strcmp (key, "view-only") == 0)
{
update_vnc_view_only (settings);
@@ -403,6 +423,7 @@ grd_settings_init (GrdSettings *settings)
update_vnc_enabled (settings);
update_vnc_view_only (settings);
update_vnc_auth_method (settings);
+ update_vnc_screen_share_mode (settings);
settings->rdp.port = GRD_RDP_SERVER_PORT;
settings->vnc.port = GRD_VNC_SERVER_PORT;
@@ -471,4 +492,11 @@ grd_settings_class_init (GrdSettingsClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
+ signals[VNC_SCREEN_SHARE_MODE_CHANGED] =
+ g_signal_new ("vnc-screen-share-mode-changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
}
diff --git a/src/grd-settings.h b/src/grd-settings.h
index 449894ae..a73e72de 100644
--- a/src/grd-settings.h
+++ b/src/grd-settings.h
@@ -65,4 +65,6 @@ gboolean grd_settings_get_vnc_view_only (GrdSettings *settings);
GrdVncAuthMethod grd_settings_get_vnc_auth_method (GrdSettings *settings);
+GrdVncScreenShareMode grd_settings_get_vnc_screen_share_mode (GrdSettings *settings);
+
#endif /* GRD_SETTINGS_H */
diff --git a/src/org.gnome.desktop.remote-desktop.gschema.xml.in
b/src/org.gnome.desktop.remote-desktop.gschema.xml.in
index 6ea48754..b67d2491 100644
--- a/src/org.gnome.desktop.remote-desktop.gschema.xml.in
+++ b/src/org.gnome.desktop.remote-desktop.gschema.xml.in
@@ -90,5 +90,31 @@
* password - by requiring the remote client to provide a known password
</description>
</key>
+ <key name='screen-share-mode' enum='org.gnome.desktop.remote-desktop.GrdVncScreenShareMode'>
+ <default>'mirror-primary'</default>
+ <summary>Screenshare mode of VNC connections</summary>
+ <description>
+ The screenshare mode specifies, whether the VNC backend mirrors the
+ primary screen, or whether a virtual monitor is created.
+
+ For the initial resolution of the virtual monitor, the VNC backend
+ uses a default size of 1920x1080 pixels.
+
+ When using a remote desktop session with a virtual monitor, clients can
+ resize the resolution of the virtual monitor during a session with the
+ setDesktopSize PDU.
+
+ 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 initial monitor resolution of this
+ virtual monitor is set to 1920x1080 pixels. Clients can
+ override the initial resolution with subsequent monitor
+ configuration updates.
+ </description>
+ </key>
</schema>
</schemalist>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]