chiark / gitweb /
Encourage choose tab's input focus to the search box a bit. Really we
[disorder] / disobedience / disobedience.c
index e8bbc400bbe5cf7a9c991dc05f621aff6d56e6db..443eaa42ca1671435059b4c0c15b718bb64df534 100644 (file)
@@ -116,11 +116,15 @@ static gboolean delete_event(GtkWidget attribute((unused)) *widget,
  *
  * Updates the menu settings to correspond to the new page.
  */
-static void tab_switched(GtkNotebook attribute((unused)) *notebook,
+static void tab_switched(GtkNotebook *notebook,
                          GtkNotebookPage attribute((unused)) *page,
                          guint page_num,
                          gpointer attribute((unused)) user_data) {
   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");
+  if(t->selected)
+    t->selected();
 }
 
 /** @brief Create the report box */