Blame SOURCES/vinagre-3.22.0-logoff.patch

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