diff --git a/.gitignore b/.gitignore index 2f0b258..8b37a48 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /gnome-remote-desktop-42.1.1.tar.xz /gnome-remote-desktop-42.2.tar.xz /gnome-remote-desktop-42.3.tar.xz +/gnome-remote-desktop-43.alpha.tar.xz diff --git a/0001-Add-man-page.patch b/0001-Add-man-page.patch deleted file mode 100644 index ef8ef47..0000000 --- a/0001-Add-man-page.patch +++ /dev/null @@ -1,220 +0,0 @@ -From 712d6a036cfb6b49ad35d4d27ba8255f5fef36b6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 14 Mar 2022 10:38:55 +0100 -Subject: [PATCH] Add man page - -Uses asciidoc; the stylesheet was copied from gnome-shell. ---- - .gitlab-ci.yml | 3 +- - man/grdctl.txt | 88 ++++++++++++++++++++++++++++++++++++++++++++++ - man/meson.build | 9 +++++ - man/stylesheet.xsl | 27 ++++++++++++++ - meson.build | 5 +++ - meson_options.txt | 5 +++ - 6 files changed, 136 insertions(+), 1 deletion(-) - create mode 100644 man/grdctl.txt - create mode 100644 man/meson.build - create mode 100644 man/stylesheet.xsl - -diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml -index f261657..735bb64 100644 ---- a/.gitlab-ci.yml -+++ b/.gitlab-ci.yml -@@ -9,7 +9,7 @@ stages: - .gnome-remote-desktop.fedora:35@common: - variables: - FDO_DISTRIBUTION_VERSION: 35 -- BASE_TAG: '2022-02-11.0' -+ BASE_TAG: '2022-03-14.0' - FDO_UPSTREAM_REPO: GNOME/gnome-remote-desktop - FDO_DISTRIBUTION_EXEC: | - dnf -y update && dnf -y upgrade && -@@ -21,6 +21,7 @@ stages: - dnf builddep -y gnome-remote-desktop && - dnf install -y 'pkgconfig(epoxy)' 'pkgconfig(libdrm)' 'pkgconfig(gbm)' \ - 'pkgconfig(gudev-1.0)' && -+ dnf install -y asciidoc && - - # To test - dnf install -y 'pkgconfig(libvncclient)' && -diff --git a/man/grdctl.txt b/man/grdctl.txt -new file mode 100644 -index 0000000..83777da ---- /dev/null -+++ b/man/grdctl.txt -@@ -0,0 +1,88 @@ -+GRDCTL(1) -+========= -+:man manual: User Commands -+:man source: GNOME-REMOTE-DESKTOP -+:doctype: manpage -+:date: March 2022 -+ -+NAME -+---- -+grdctl - Command line tool for configuring GNOME Remote Desktop -+ -+SYNOPSIS -+-------- -+*grdctl* ['OPTION'...] ['COMMAND'] ['SUBCOMMAND'...] -+ -+DESCRIPTION -+----------- -+grdctl provides methods for configuring the GNOME Remote Desktop service, -+for example setting credentials. -+ -+OPTIONS -+------- -+*--help*:: -+Show help text. -+ -+GENERAL COMMANDS -+---------------- -+*status*:: -+Show current status. -+ -+RDP COMMANDS -+------------ -+*rdp* *enable*:: -+Enable the RDP backend. -+ -+*rdp* *disable*:: -+Disable the RDP backend. -+ -+*rdp* *set-tls-cert* 'TLS-CERT':: -+Set path to TLS certificate. -+ -+*rdp* *set-tls-key* 'TLS-KEY':: -+Set path to TLS key. -+ -+*rdp* *set-credentials* 'USERNAME' 'PASSWORD':: -+Set username and password credentials. -+ -+*rdp* *clear-credentials*:: -+Clear username and password credentials. -+ -+*rdp* *enable-view-only*:: -+Disable remote control of input devices. -+ -+*rdp* *disable-view-only*:: -+Enable remote control of input devices. -+ -+VNC COMMANDS -+------------ -+*vnc* *enable*:: -+Enable the VNC backend. -+ -+*vnc* *disable*:: -+Disable the VNC backend. -+ -+*vnc* *set-password* 'PASSWORD':: -+Set the VNC password. -+ -+*vnc* *clear-password*:: -+Clear the VNC password. -+ -+*vnc* *set-auth-method* 'AUTH-METHOD':: -+Set the authorization method used for new VNC connections. Can be either -+*password* or *prompt*. -+ -+*vnc* *enable-view-only*: -+Disable remote control of input devices. -+ -+*vnc* *disable-view-only*:: -+Enable remote control of input devices. -+ -+BUGS -+---- -+The bug tracker can be reached by visiting the website -+https://gitlab.gnome.org/GNOME/gnome-remote-desktop/issues. Before sending -+a bug report, please verify that you have the latest version of -+gnome-remote-desktop. Many bugs (major and minor) are fixed at each -+release, and if yours is out of date, the problem may already have been -+solved. -diff --git a/man/meson.build b/man/meson.build -new file mode 100644 -index 0000000..1e73f11 ---- /dev/null -+++ b/man/meson.build -@@ -0,0 +1,9 @@ -+a2x = find_program('a2x') -+ -+custom_target('man page', -+ input: ['grdctl.txt', 'stylesheet.xsl'], -+ output: 'grdctl.1', -+ command: [a2x, '-v', '-D', '@OUTDIR@', '--xsl-file', '@INPUT1@', '-f' ,'manpage', '@INPUT0@'], -+ install_dir: mandir + '/man1', -+ install: true -+) -diff --git a/man/stylesheet.xsl b/man/stylesheet.xsl -new file mode 100644 -index 0000000..047bd1b ---- /dev/null -+++ b/man/stylesheet.xsl -@@ -0,0 +1,27 @@ -+ -+ -+ -+ -+ -+ .PP -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ .RS 4 -+ -+ .\" -+ -+ -+ -+ .RE -+ -+ -+ -+ -diff --git a/meson.build b/meson.build -index 6bd2420..0660cd0 100644 ---- a/meson.build -+++ b/meson.build -@@ -55,6 +55,7 @@ endif - prefix = get_option('prefix') - libexecdir = join_paths(prefix, get_option('libexecdir')) - datadir = join_paths(prefix, get_option('datadir')) -+mandir = join_paths(prefix, get_option('mandir')) - schemadir = join_paths(datadir, 'glib-2.0', 'schemas') - - grd_datadir = join_paths(datadir, 'gnome-remote-desktop') -@@ -93,6 +94,10 @@ subdir('src') - subdir('tests') - subdir('po') - -+if get_option('man') -+ subdir('man') -+endif -+ - meson.add_install_script('meson_post_install.py') - - output = [ -diff --git a/meson_options.txt b/meson_options.txt -index 3527588..2897f30 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -1,3 +1,8 @@ -+option('man', -+ type: 'boolean', -+ value: true, -+ description: 'Generate man pages') -+ - option('rdp', - type: 'boolean', - value: true, --- -2.34.1 - diff --git a/gnome-remote-desktop.spec b/gnome-remote-desktop.spec index 19ce35c..b1c0a6c 100644 --- a/gnome-remote-desktop.spec +++ b/gnome-remote-desktop.spec @@ -3,19 +3,17 @@ %global tarball_version %%(echo %{version} | tr '~' '.') Name: gnome-remote-desktop -Version: 42.3 -Release: 2%{?dist} +Version: 43~alpha +Release: 1%{?dist} Summary: GNOME Remote Desktop screen share service License: GPLv2+ URL: https://gitlab.gnome.org/GNOME/gnome-remote-desktop -Source0: https://download.gnome.org/sources/%{name}/42/%{name}-%{tarball_version}.tar.xz +Source0: https://download.gnome.org/sources/%{name}/43/%{name}-%{tarball_version}.tar.xz # Adds encryption support (requires patched LibVNCServer) Patch0: gnutls-anontls.patch -Patch1: 0001-Add-man-page.patch - BuildRequires: asciidoc BuildRequires: gcc BuildRequires: meson >= 0.47.0 @@ -91,6 +89,9 @@ GNOME desktop environment. %changelog +* Thu Jul 28 2022 Jonas Ã…dahl - 43~alpha +- Update to 43.alpha + * Thu Jul 21 2022 Fedora Release Engineering - 42.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/gnutls-anontls.patch b/gnutls-anontls.patch index d36acfd..3e5bd30 100644 --- a/gnutls-anontls.patch +++ b/gnutls-anontls.patch @@ -1,4 +1,4 @@ -From 63d1c041e3997bfc78803b4d0fe09d96b53c9e50 Mon Sep 17 00:00:00 2001 +From a371957f58dc2d5022b2b145d15081e1b9cab629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 14 Jun 2018 12:21:37 +0200 Subject: [PATCH 1/7] vnc: Add anonymous TLS encryption support @@ -25,13 +25,13 @@ VNC connection. create mode 100644 src/grd-vnc-tls.h diff --git a/meson.build b/meson.build -index 72d34a4..9a341fa 100644 +index 3e7c272..17d85d9 100644 --- a/meson.build +++ b/meson.build @@ -50,6 +50,7 @@ endif if have_vnc - libvncserver_dep = dependency('libvncserver') libvncclient_dep = dependency('libvncclient') + libvncserver_dep = dependency('libvncserver') + gnutls_dep = dependency('gnutls') endif @@ -924,7 +924,7 @@ index 0000000..135ef8c + +#endif /* GRD_VNC_TLS_H */ diff --git a/src/meson.build b/src/meson.build -index 1d671d7..ab675ff 100644 +index 3def890..31f11fa 100644 --- a/src/meson.build +++ b/src/meson.build @@ -115,10 +115,13 @@ if have_vnc @@ -942,7 +942,7 @@ index 1d671d7..ab675ff 100644 endif diff --git a/src/org.gnome.desktop.remote-desktop.gschema.xml.in b/src/org.gnome.desktop.remote-desktop.gschema.xml.in -index 939b9a6..e57affb 100644 +index 6ea4875..4d36b5d 100644 --- a/src/org.gnome.desktop.remote-desktop.gschema.xml.in +++ b/src/org.gnome.desktop.remote-desktop.gschema.xml.in @@ -90,5 +90,15 @@ @@ -962,13 +962,181 @@ index 939b9a6..e57affb 100644 -- -2.36.1 +2.35.3 -From 38d981d05fa79da2aa15076637253f6c4cc606d9 Mon Sep 17 00:00:00 2001 +From 817a3712b076a0054e0ee78e9bf0b31d203a954d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Wed, 27 Nov 2019 11:02:09 +0100 +Subject: [PATCH 2/7] session-vnc: Add paused/resumed signals + +Paused is when the socket sourec is detached, and resumed when attached. +Meant to be used by the TLS channel security to a attach/detach +out-of-socket source. +--- + src/grd-session-vnc.c | 72 ++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 65 insertions(+), 7 deletions(-) + +diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c +index fa694f0..8173897 100644 +--- a/src/grd-session-vnc.c ++++ b/src/grd-session-vnc.c +@@ -41,14 +41,27 @@ + #define BGRX_SAMPLES_PER_PIXEL 3 + #define BGRX_BYTES_PER_PIXEL 4 + ++enum ++{ ++ PAUSED, ++ RESUMED, ++ ++ N_SIGNALS ++}; ++ ++static guint signals[N_SIGNALS]; ++ + struct _GrdSessionVnc + { + GrdSession parent; + + GrdVncServer *vnc_server; + GSocketConnection *connection; ++ + GList *socket_grabs; + GSource *source; ++ gboolean is_paused; ++ + rfbScreenInfoPtr rfb_screen; + rfbClientPtr rfb_client; + +@@ -77,7 +90,7 @@ struct _GrdSessionVnc + G_DEFINE_TYPE (GrdSessionVnc, grd_session_vnc, GRD_TYPE_SESSION) + + static void +-grd_session_vnc_detach_source (GrdSessionVnc *session_vnc); ++grd_session_vnc_pause (GrdSessionVnc *session_vnc); + + static gboolean + close_session_idle (gpointer user_data); +@@ -236,7 +249,8 @@ handle_client_gone (rfbClientPtr rfb_client) + + g_debug ("VNC client gone"); + +- grd_session_vnc_detach_source (session_vnc); ++ grd_session_vnc_pause (session_vnc); ++ + maybe_queue_close_session_idle (session_vnc); + session_vnc->rfb_client = NULL; + } +@@ -305,7 +319,7 @@ handle_new_client (rfbClientPtr rfb_client) + session_vnc->prompt_cancellable, + prompt_response_callback, + session_vnc); +- grd_session_vnc_detach_source (session_vnc); ++ grd_session_vnc_pause (session_vnc); + return RFB_CLIENT_ON_HOLD; + case GRD_VNC_AUTH_METHOD_PASSWORD: + session_vnc->rfb_screen->passwordCheck = check_rfb_password; +@@ -536,7 +550,7 @@ check_rfb_password (rfbClientPtr rfb_client, + if (memcmp (challenge_encrypted, response_encrypted, len) == 0) + { + grd_session_start (GRD_SESSION (session_vnc)); +- grd_session_vnc_detach_source (session_vnc); ++ grd_session_vnc_pause (session_vnc); + return TRUE; + } + else +@@ -725,6 +739,36 @@ grd_session_vnc_detach_source (GrdSessionVnc *session_vnc) + g_clear_pointer (&session_vnc->source, g_source_unref); + } + ++gboolean ++grd_session_vnc_is_paused (GrdSessionVnc *session_vnc) ++{ ++ return session_vnc->is_paused; ++} ++ ++static void ++grd_session_vnc_pause (GrdSessionVnc *session_vnc) ++{ ++ if (grd_session_vnc_is_paused (session_vnc)) ++ return; ++ ++ session_vnc->is_paused = TRUE; ++ ++ grd_session_vnc_detach_source (session_vnc); ++ g_signal_emit (session_vnc, signals[PAUSED], 0); ++} ++ ++static void ++grd_session_vnc_resume (GrdSessionVnc *session_vnc) ++{ ++ if (!grd_session_vnc_is_paused (session_vnc)) ++ return; ++ ++ session_vnc->is_paused = FALSE; ++ ++ grd_session_vnc_attach_source (session_vnc); ++ g_signal_emit (session_vnc, signals[RESUMED], 0); ++} ++ + GrdSessionVnc * + grd_session_vnc_new (GrdVncServer *vnc_server, + GSocketConnection *connection) +@@ -742,6 +786,7 @@ grd_session_vnc_new (GrdVncServer *vnc_server, + + grd_session_vnc_grab_socket (session_vnc, vnc_socket_grab_func); + grd_session_vnc_attach_source (session_vnc); ++ session_vnc->is_paused = FALSE; + + init_vnc_session (session_vnc); + +@@ -771,7 +816,7 @@ grd_session_vnc_stop (GrdSession *session) + + g_clear_object (&session_vnc->pipewire_stream); + +- grd_session_vnc_detach_source (session_vnc); ++ grd_session_vnc_pause (session_vnc); + + g_clear_object (&session_vnc->connection); + g_clear_object (&session_vnc->clipboard_vnc); +@@ -831,8 +876,8 @@ grd_session_vnc_stream_ready (GrdSession *session, + G_CALLBACK (on_pipewire_stream_closed), + session_vnc); + +- if (!session_vnc->source) +- grd_session_vnc_attach_source (session_vnc); ++ if (grd_session_vnc_is_paused (session_vnc)) ++ grd_session_vnc_resume (session_vnc); + } + + static void +@@ -853,4 +898,17 @@ grd_session_vnc_class_init (GrdSessionVncClass *klass) + session_class->remote_desktop_session_started = + grd_session_vnc_remote_desktop_session_started; + session_class->stream_ready = grd_session_vnc_stream_ready; ++ ++ signals[PAUSED] = g_signal_new ("paused", ++ G_TYPE_FROM_CLASS (klass), ++ G_SIGNAL_RUN_LAST, ++ 0, ++ NULL, NULL, NULL, ++ G_TYPE_NONE, 0); ++ signals[RESUMED] = g_signal_new ("resumed", ++ G_TYPE_FROM_CLASS (klass), ++ G_SIGNAL_RUN_LAST, ++ 0, ++ NULL, NULL, NULL, ++ G_TYPE_NONE, 0); + } +-- +2.35.3 + + +From 9581bf42a2a03cc1b80c2d0b61304e2b1594fa81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 27 Nov 2019 11:03:46 +0100 -Subject: [PATCH 2/7] session-vnc: Add grd_session_vnc_dispatch() helper +Subject: [PATCH 3/7] session-vnc: Add grd_session_vnc_dispatch() helper To be used by the TLS channel security to dispatch when there is data available that is not visible to the socket source. @@ -978,10 +1146,10 @@ available that is not visible to the socket source. 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c -index fa694f0..1edd33a 100644 +index 8173897..39d3ead 100644 --- a/src/grd-session-vnc.c +++ b/src/grd-session-vnc.c -@@ -661,6 +661,21 @@ vnc_socket_grab_func (GrdSessionVnc *session_vnc, +@@ -675,6 +675,21 @@ vnc_socket_grab_func (GrdSessionVnc *session_vnc, return TRUE; } @@ -1003,7 +1171,7 @@ index fa694f0..1edd33a 100644 static gboolean handle_socket_data (GSocket *socket, GIOCondition condition, -@@ -677,16 +692,7 @@ handle_socket_data (GSocket *socket, +@@ -691,16 +706,7 @@ handle_socket_data (GSocket *socket, } else if (condition & G_IO_IN) { @@ -1035,13 +1203,13 @@ index 092d9dc..e9eced0 100644 #endif /* GRD_SESSION_VNC_H */ -- -2.36.1 +2.35.3 -From 9aacfa825fcdef0f2eb87b7f48872b1a93ec7923 Mon Sep 17 00:00:00 2001 +From 3c10a7ba8514a4f5f9b7af2556330ba00db576ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 27 Nov 2019 11:05:13 +0100 -Subject: [PATCH 3/7] vnc/tls: Add some logging +Subject: [PATCH 4/7] vnc/tls: Add some logging Uses the log utility from libvncserver as it is related to the RFB protocol rather than the session itself. @@ -1112,13 +1280,13 @@ index ec4758e..ac6c35f 100644 { g_warning ("TLS handshake failed: %s", error->message); -- -2.36.1 +2.35.3 -From aeaa81db6cf160a32c8d83a945c860bb7451babf Mon Sep 17 00:00:00 2001 +From 1f5ba28f773b3b6b5f238df93c27dec8402684d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 27 Nov 2019 11:07:40 +0100 -Subject: [PATCH 4/7] vnc/tls: Dispatch also when data is pending outside of +Subject: [PATCH 5/7] vnc/tls: Dispatch also when data is pending outside of the socket gnutls may have data available in its buffers, and we have our own peek @@ -1282,216 +1450,13 @@ index ac6c35f..312b6b9 100644 } -- -2.36.1 +2.35.3 -From be203b966ff119e82ea7ac9894b67a1db2f55f26 Mon Sep 17 00:00:00 2001 +From c6ed5cc1fb612099eca207297dcb80a2c9a77112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Mon, 12 Oct 2020 17:34:30 +0200 -Subject: [PATCH 5/7] vnc: Copy pixels using the right destination stride - -We're copying the pixels in a separate thread managed by PipeWire, and -in this thread, accessing the VNC framebuffer dimension and stride is -racy. Instead of fetching the dimension directly, pass the expected -width and get the stride it will eventually have. - -Already before this patch, when the copied pixel end up on the main -thread and the dimension still doesn't match up, the frame will be -dropped. ---- - src/grd-session-vnc.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/grd-session-vnc.h b/src/grd-session-vnc.h -index 8a916b7..e85f31e 100644 ---- a/src/grd-session-vnc.h -+++ b/src/grd-session-vnc.h -@@ -67,7 +67,8 @@ int grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc, - - int grd_session_vnc_get_fd (GrdSessionVnc *session_vnc); - --int grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc); -+int grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc, -+ int width); - - gboolean grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc); - --- -2.36.1 - - -From ffd24b13dfce2e89acf5eb6ccd7bb6b90487e547 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Wed, 11 May 2022 11:17:00 +0100 -Subject: [PATCH 6/7] session-vnc: Add paused/resumed signals - -Paused is when the socket sourec is detached, and resumed when attached. -Meant to be used by the TLS channel security to a attach/detach -out-of-socket source. ---- - src/grd-session-vnc.c | 72 ++++++++++++++++++++++++++++++++++++++----- - 1 file changed, 65 insertions(+), 7 deletions(-) - -diff --git a/src/grd-session-vnc.c b/src/grd-session-vnc.c -index 1edd33a..39d3ead 100644 ---- a/src/grd-session-vnc.c -+++ b/src/grd-session-vnc.c -@@ -41,14 +41,27 @@ - #define BGRX_SAMPLES_PER_PIXEL 3 - #define BGRX_BYTES_PER_PIXEL 4 - -+enum -+{ -+ PAUSED, -+ RESUMED, -+ -+ N_SIGNALS -+}; -+ -+static guint signals[N_SIGNALS]; -+ - struct _GrdSessionVnc - { - GrdSession parent; - - GrdVncServer *vnc_server; - GSocketConnection *connection; -+ - GList *socket_grabs; - GSource *source; -+ gboolean is_paused; -+ - rfbScreenInfoPtr rfb_screen; - rfbClientPtr rfb_client; - -@@ -77,7 +90,7 @@ struct _GrdSessionVnc - G_DEFINE_TYPE (GrdSessionVnc, grd_session_vnc, GRD_TYPE_SESSION) - - static void --grd_session_vnc_detach_source (GrdSessionVnc *session_vnc); -+grd_session_vnc_pause (GrdSessionVnc *session_vnc); - - static gboolean - close_session_idle (gpointer user_data); -@@ -236,7 +249,8 @@ handle_client_gone (rfbClientPtr rfb_client) - - g_debug ("VNC client gone"); - -- grd_session_vnc_detach_source (session_vnc); -+ grd_session_vnc_pause (session_vnc); -+ - maybe_queue_close_session_idle (session_vnc); - session_vnc->rfb_client = NULL; - } -@@ -305,7 +319,7 @@ handle_new_client (rfbClientPtr rfb_client) - session_vnc->prompt_cancellable, - prompt_response_callback, - session_vnc); -- grd_session_vnc_detach_source (session_vnc); -+ grd_session_vnc_pause (session_vnc); - return RFB_CLIENT_ON_HOLD; - case GRD_VNC_AUTH_METHOD_PASSWORD: - session_vnc->rfb_screen->passwordCheck = check_rfb_password; -@@ -536,7 +550,7 @@ check_rfb_password (rfbClientPtr rfb_client, - if (memcmp (challenge_encrypted, response_encrypted, len) == 0) - { - grd_session_start (GRD_SESSION (session_vnc)); -- grd_session_vnc_detach_source (session_vnc); -+ grd_session_vnc_pause (session_vnc); - return TRUE; - } - else -@@ -731,6 +745,36 @@ grd_session_vnc_detach_source (GrdSessionVnc *session_vnc) - g_clear_pointer (&session_vnc->source, g_source_unref); - } - -+gboolean -+grd_session_vnc_is_paused (GrdSessionVnc *session_vnc) -+{ -+ return session_vnc->is_paused; -+} -+ -+static void -+grd_session_vnc_pause (GrdSessionVnc *session_vnc) -+{ -+ if (grd_session_vnc_is_paused (session_vnc)) -+ return; -+ -+ session_vnc->is_paused = TRUE; -+ -+ grd_session_vnc_detach_source (session_vnc); -+ g_signal_emit (session_vnc, signals[PAUSED], 0); -+} -+ -+static void -+grd_session_vnc_resume (GrdSessionVnc *session_vnc) -+{ -+ if (!grd_session_vnc_is_paused (session_vnc)) -+ return; -+ -+ session_vnc->is_paused = FALSE; -+ -+ grd_session_vnc_attach_source (session_vnc); -+ g_signal_emit (session_vnc, signals[RESUMED], 0); -+} -+ - GrdSessionVnc * - grd_session_vnc_new (GrdVncServer *vnc_server, - GSocketConnection *connection) -@@ -748,6 +792,7 @@ grd_session_vnc_new (GrdVncServer *vnc_server, - - grd_session_vnc_grab_socket (session_vnc, vnc_socket_grab_func); - grd_session_vnc_attach_source (session_vnc); -+ session_vnc->is_paused = FALSE; - - init_vnc_session (session_vnc); - -@@ -777,7 +822,7 @@ grd_session_vnc_stop (GrdSession *session) - - g_clear_object (&session_vnc->pipewire_stream); - -- grd_session_vnc_detach_source (session_vnc); -+ grd_session_vnc_pause (session_vnc); - - g_clear_object (&session_vnc->connection); - g_clear_object (&session_vnc->clipboard_vnc); -@@ -837,8 +882,8 @@ grd_session_vnc_stream_ready (GrdSession *session, - G_CALLBACK (on_pipewire_stream_closed), - session_vnc); - -- if (!session_vnc->source) -- grd_session_vnc_attach_source (session_vnc); -+ if (grd_session_vnc_is_paused (session_vnc)) -+ grd_session_vnc_resume (session_vnc); - } - - static void -@@ -859,4 +904,17 @@ grd_session_vnc_class_init (GrdSessionVncClass *klass) - session_class->remote_desktop_session_started = - grd_session_vnc_remote_desktop_session_started; - session_class->stream_ready = grd_session_vnc_stream_ready; -+ -+ signals[PAUSED] = g_signal_new ("paused", -+ G_TYPE_FROM_CLASS (klass), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, NULL, -+ G_TYPE_NONE, 0); -+ signals[RESUMED] = g_signal_new ("resumed", -+ G_TYPE_FROM_CLASS (klass), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, NULL, -+ G_TYPE_NONE, 0); - } --- -2.36.1 - - -From 156cd6920fd461a677c3eb848590a88249079303 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Jonas=20=C3=85dahl?= -Date: Wed, 11 May 2022 11:19:26 +0100 -Subject: [PATCH 7/7] session-vnc: Set our own password handling function up +Date: Wed, 27 Nov 2019 16:48:00 +0100 +Subject: [PATCH 6/7] session-vnc: Set our own password handling function up front libvncserver decides whether to register a auth security handler @@ -1540,5 +1505,40 @@ index 39d3ead..6d0e5e2 100644 rfbProcessEvents (rfb_screen, 0); } -- -2.36.1 +2.35.3 + + +From b7420dcf10c92974efa17d8584f7a4d2773dd425 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jonas=20=C3=85dahl?= +Date: Mon, 12 Oct 2020 17:34:30 +0200 +Subject: [PATCH 7/7] vnc: Copy pixels using the right destination stride + +We're copying the pixels in a separate thread managed by PipeWire, and +in this thread, accessing the VNC framebuffer dimension and stride is +racy. Instead of fetching the dimension directly, pass the expected +width and get the stride it will eventually have. + +Already before this patch, when the copied pixel end up on the main +thread and the dimension still doesn't match up, the frame will be +dropped. +--- + src/grd-session-vnc.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/grd-session-vnc.h b/src/grd-session-vnc.h +index 8a916b7..e85f31e 100644 +--- a/src/grd-session-vnc.h ++++ b/src/grd-session-vnc.h +@@ -67,7 +67,8 @@ int grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc, + + int grd_session_vnc_get_fd (GrdSessionVnc *session_vnc); + +-int grd_session_vnc_get_framebuffer_stride (GrdSessionVnc *session_vnc); ++int grd_session_vnc_get_stride_for_width (GrdSessionVnc *session_vnc, ++ int width); + + gboolean grd_session_vnc_is_client_gone (GrdSessionVnc *session_vnc); + +-- +2.35.3 diff --git a/sources b/sources index e04d4b6..6b3c9d8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gnome-remote-desktop-42.3.tar.xz) = 3545ec6b3f7f80315546d03ecb0c30ed554e879c743e1d7031ac65cf10e6d9d510553049393221be0be203a79b8be8bc96c0d3fe600be1ac3c0a1e24431ba945 +SHA512 (gnome-remote-desktop-43.alpha.tar.xz) = 1f885f5ddbf21821107f18a277c419864d0bb7a8b5c031282868318393febc97837e5e28324f667f7f4406d29d4309f412a537fca339668a9a215797a1685027