[gnome-remote-desktop] session: Only set clipboard pointer, when initialization was successful



commit 205c5016b0000e462657779bfd069f1270571a90
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Tue Aug 23 05:12:43 2022 +0200

    session: Only set clipboard pointer, when initialization was successful
    
    When enabling the clipboard, the clipboard instance uses the return
    value to determine, whether requests from mutter are possible or not.
    When enabling the clipboard failed, the return value is recognized, but
    the clipboard pointer in the session class is still set, leading to an
    assertion hit, when a request from mutter is received, but the
    clipboard was actually never successfully enabled.
    
    To fix this issue, simply only set the clipboard pointer, when enabling
    the clipboard was successful.
    
    https://errors.ubuntu.com/problem/e118a2a1b7e6650ee263f50f52fdab8a5dcd18ee

 src/grd-session.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/grd-session.c b/src/grd-session.c
index 46696a46..aeed4023 100644
--- a/src/grd-session.c
+++ b/src/grd-session.c
@@ -480,8 +480,6 @@ grd_session_enable_clipboard (GrdSession   *session,
   if (!priv->remote_desktop_session)
     return FALSE;
 
-  priv->clipboard = clipboard;
-
   options_variant = serialize_clipboard_options (mime_type_tables);
   if (!grd_dbus_remote_desktop_session_call_enable_clipboard_sync (
          priv->remote_desktop_session, options_variant, NULL, &error))
@@ -489,6 +487,7 @@ grd_session_enable_clipboard (GrdSession   *session,
       g_warning ("Failed to enable clipboard: %s", error->message);
       return FALSE;
     }
+  priv->clipboard = clipboard;
 
   return TRUE;
 }


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