Blame SOURCES/vinagre-3.22.0-logoff.patch

ccf9f0
--- vinagre-3.22.0/plugins/rdp/vinagre-rdp-tab.c
ccf9f0
+++ vinagre-3.22.0/plugins/rdp/vinagre-rdp-tab.c
ccf9f0
@@ -663,7 +663,7 @@ update (gpointer user_data)
ccf9f0
                         wfds, &wcount))
ccf9f0
     {
ccf9f0
       g_warning ("Failed to get FreeRDP file descriptor\n");
ccf9f0
-      return FALSE;
ccf9f0
+      goto remove;
ccf9f0
     }
ccf9f0
 
ccf9f0
   max_fds = 0;
ccf9f0
@@ -681,7 +681,7 @@ update (gpointer user_data)
ccf9f0
     }
ccf9f0
 
ccf9f0
   if (max_fds == 0)
ccf9f0
-    return FALSE;
ccf9f0
+    goto remove;
ccf9f0
 
ccf9f0
   timeout.tv_sec = 0;
ccf9f0
   timeout.tv_usec = SELECT_TIMEOUT;
ccf9f0
@@ -696,14 +696,21 @@ update (gpointer user_data)
ccf9f0
             (errno == EINTR))) /* signal occurred */
ccf9f0
       {
ccf9f0
         g_warning ("update: select failed\n");
ccf9f0
-        return FALSE;
ccf9f0
+        goto remove;
ccf9f0
       }
ccf9f0
     }
ccf9f0
 
ccf9f0
   if (!freerdp_check_fds (priv->freerdp_session))
ccf9f0
     {
ccf9f0
-      g_warning ("Failed to check FreeRDP file descriptor\n");
ccf9f0
-      return FALSE;
ccf9f0
+      if (freerdp_shall_disconnect (priv->freerdp_session))
ccf9f0
+        g_idle_add ((GSourceFunc) idle_close, rdp_tab);
ccf9f0
+
ccf9f0
+#ifdef HAVE_FREERDP_1_2
ccf9f0
+      if (freerdp_get_last_error (priv->freerdp_session->context) != FREERDP_ERROR_LOGOFF_BY_USER)
ccf9f0
+#endif
ccf9f0
+        g_warning ("Failed to check FreeRDP file descriptor\n");
ccf9f0
+
ccf9f0
+      goto remove;
ccf9f0
     }
ccf9f0
 
ccf9f0
   frdp_process_events (priv->freerdp_session, priv->events);
ccf9f0
@@ -711,10 +718,14 @@ update (gpointer user_data)
ccf9f0
   if (freerdp_shall_disconnect (priv->freerdp_session))
ccf9f0
     {
ccf9f0
       g_idle_add ((GSourceFunc) idle_close, rdp_tab);
ccf9f0
-      return FALSE;
ccf9f0
+      goto remove;
ccf9f0
     }
ccf9f0
 
ccf9f0
-  return TRUE;
ccf9f0
+  return G_SOURCE_CONTINUE;
ccf9f0
+
ccf9f0
+remove:
ccf9f0
+  rdp_tab->priv->update_id = 0;
ccf9f0
+  return G_SOURCE_REMOVE;
ccf9f0
 }
ccf9f0
 
ccf9f0
 static gboolean