chiark / gitweb /
README updates especially for OS X
[disorder] / disobedience / client.c
index d03e9de2776ed89ed906c3333f673a1ed411c4c0..869bcf3db148d8592eb0d54766b610cc9e4d761e 100644 (file)
@@ -110,6 +110,9 @@ static void gtkclient_poll(void *u,
 static void gtkclient_comms_error(void attribute((unused)) *u,
                                  const char *msg) {
   D(("gtkclient_comms_error %s", msg));
+  /* Control buttons might have become unusable */
+  control_update();
+  menu_update(-1);
   gtk_label_set_text(GTK_LABEL(report_label), msg);
 }
 
@@ -134,6 +137,8 @@ static void gtkclient_report(void attribute((unused)) *u,
   if(!msg)
     /* We're idle - clear the report line */
     gtk_label_set_text(GTK_LABEL(report_label), "");
+  control_update();
+  menu_update(-1);
 }
 
 void popup_protocol_error(int attribute((unused)) code,
@@ -161,6 +166,10 @@ disorder_eclient *gtkclient(void) {
   esource = (struct eclient_source *)source;
   esource->pollfd.fd = -1;
   esource->client = disorder_eclient_new(&gtkclient_callbacks, source);
+  if(!esource->client) {
+    g_source_destroy(source);
+    return 0;
+  }
   g_source_attach(source, 0);
   return esource->client;
 }
@@ -173,4 +182,3 @@ fill-column:79
 indent-tabs-mode:nil
 End:
 */
-/* arch-tag:32Qju8BYS5FZvqbPHElgcg */