Blob Blame History Raw
From e3530d3ee97df1f78c15172abb0511ce12f1175b Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 31 Mar 2017 15:11:03 -0400
Subject: [PATCH 10/13] chooser: fix duplicate entry in the list

---
 chooser/gdm-host-chooser-widget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chooser/gdm-host-chooser-widget.c b/chooser/gdm-host-chooser-widget.c
index f9200aa0..b8924618 100644
--- a/chooser/gdm-host-chooser-widget.c
+++ b/chooser/gdm-host-chooser-widget.c
@@ -246,62 +246,62 @@ decode_packet (GIOChannel           *source,
                 }
 
                 if (! XdmcpReadARRAY8 (&buf, &stat)) {
                         goto done;
                 }
 
                 status = g_strndup ((char *) stat.data, MIN (stat.length, 256));
         } else if (header.opcode == UNWILLING) {
                 /* immaterial, will not be shown */
                 status = NULL;
         } else {
                 goto done;
         }
 
         g_debug ("STATUS: %s", status);
 
         chooser_host = find_known_host (widget, address);
         if (chooser_host == NULL) {
                 chooser_host = g_object_new (GDM_TYPE_CHOOSER_HOST,
                                              "address", address,
                                              "description", status,
                                              "willing", (header.opcode == WILLING),
                                              "kind", GDM_CHOOSER_HOST_KIND_XDMCP,
                                              NULL);
                 chooser_host_add (widget, chooser_host);
                 browser_add_host (widget, chooser_host);
         } else {
                 /* server changed it's mind */
                 if (header.opcode == WILLING
                     && ! gdm_chooser_host_get_willing (chooser_host)) {
-                        g_object_set (chooser_host, "willing", TRUE, NULL);
                         browser_add_host (widget, chooser_host);
+                        g_object_set (chooser_host, "willing", TRUE, NULL);
                 }
                 /* FIXME: handle unwilling? */
         }
 
  done:
         if (header.opcode == WILLING) {
                 XdmcpDisposeARRAY8 (&auth);
                 XdmcpDisposeARRAY8 (&host);
                 XdmcpDisposeARRAY8 (&stat);
         }
 
         g_free (status);
         gdm_address_free (address);
 
         return TRUE;
 }
 
 static void
 do_ping (GdmHostChooserWidget *widget,
          gboolean              full)
 {
         GSList *l;
 
         g_debug ("do ping full:%d", full);
 
         for (l = widget->priv->broadcast_addresses; l != NULL; l = l->next) {
                 GdmAddress              *address;
                 int                      res;
 
                 address = l->data;
-- 
2.12.0