chiark / gitweb /
Fix edit menu (and simplify its implementation a bit).
[disorder] / disobedience / disobedience.c
index 443eaa42ca1671435059b4c0c15b718bb64df534..5acadf894e10d22f287039f9f274dfbdb757fdb0 100644 (file)
@@ -96,6 +96,8 @@ int rtp_supported;
 /** @brief True if RTP play is enabled */
 int rtp_is_running;
 
+static void check_rtp_address(void);
+
 /* Window creation --------------------------------------------------------- */
 
 /* Note that all the client operations kicked off from here will only complete
@@ -123,6 +125,7 @@ static void tab_switched(GtkNotebook *notebook,
   menu_update(page_num);
   GtkWidget *const tab = gtk_notebook_get_nth_page(notebook, page_num);
   const struct tabtype *const t = g_object_get_data(G_OBJECT(tab), "type");
+  assert(t != 0);
   if(t->selected)
     t->selected();
 }
@@ -325,6 +328,8 @@ static gboolean periodic_slow(gpointer attribute((unused)) data) {
                               config->username, "rights",
                               0);
   }
+  /* Recheck RTP status too */
+  check_rtp_address();
   return TRUE;                          /* don't remove me */
 }
 
@@ -449,7 +454,6 @@ void logged_in(void) {
   rtp_supported = 0;
   event_raise("logged-in", 0);
   /* Force the periodic checks */
-  check_rtp_address();
   periodic_slow(0);
   periodic_fast(0);
 }
@@ -509,7 +513,6 @@ int main(int argc, char **argv) {
   /* Start monitoring the log */
   disorder_eclient_log(logclient, &log_callbacks, 0);
   /* Initiate all the checks */
-  check_rtp_address();
   periodic_slow(0);
   periodic_fast(0);
   suppress_actions = 0;