[gnome-remote-desktop] session: Also clear signal handler, when the session proxy is closed



commit cdbdc70f6dc586411025bac8867056edf4d93147
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Thu Jan 20 14:32:54 2022 +0100

    session: Also clear signal handler, when the session proxy is closed
    
    When the remote desktop session is closed from the mutter side,
    gnome-remote-desktop will clear the proxy and stop the session.
    When this happens, the signal handler for the CAPS-lock and NUM-lock
    signals are not set to 0, despite the remote desktop proxy already
    been cleared.
    This situation does not lead to a crash, but to unpleasant error
    messages.
    
    To fix this situation, clear the signal handlers before clearing the
    remote desktop session proxy.
    Usually this situation happens, when calling methods, that make mutter
    close the remote desktop session.
    One such situation is, when attempting to create and record a virtual
    monitor in an X11 session.

 src/grd-session.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/grd-session.c b/src/grd-session.c
index e1bd68f5..46696a46 100644
--- a/src/grd-session.c
+++ b/src/grd-session.c
@@ -764,6 +764,11 @@ on_remote_desktop_session_closed (GrdDBusRemoteDesktopSession *session_proxy,
 {
   GrdSessionPrivate *priv = grd_session_get_instance_private (session);
 
+  g_clear_signal_handler (&priv->caps_lock_state_changed_id,
+                          priv->remote_desktop_session);
+  g_clear_signal_handler (&priv->num_lock_state_changed_id,
+                          priv->remote_desktop_session);
+
   g_clear_object (&priv->remote_desktop_session);
   g_clear_object (&priv->screen_cast_session);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]