+/* Tracking of window sizes */
+static int toplevel_width = 640, toplevel_height = 480;
+static int mini_width = 480, mini_height = 140;
+
+static void main_minimode(const char attribute((unused)) *event,
+ void attribute((unused)) *evendata,
+ void attribute((unused)) *callbackdata) {
+ if(full_mode) {
+ gtk_widget_show(tabs);
+ gtk_widget_hide(playing_mini);
+ /* Show the queue (bit confusing otherwise!) */
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(tabs), 0);
+ gtk_window_resize(GTK_WINDOW(toplevel), toplevel_width, toplevel_height);
+ } else {
+ gtk_widget_hide(tabs);
+ gtk_widget_show(playing_mini);
+ gtk_window_resize(GTK_WINDOW(toplevel), mini_width, mini_height);
+ }
+}
+
+/* Called when the window size is allocate */
+static void toplevel_size_allocate(GtkWidget attribute((unused)) *w,
+ GtkAllocation *a,
+ gpointer attribute((unused)) user_data) {
+ if(full_mode) {
+ toplevel_width = a->width;
+ toplevel_height = a->height;
+ } else {
+ mini_width = a->width;
+ mini_height = a->height;
+ }
+}
+