- /* Remove notebook from display */
- g_object_ref(tabs);
- gtk_container_remove(GTK_CONTAINER(notebook_box), tabs);
- /* Remove queue from notebook */
- g_object_ref(queue);
- gtk_container_remove(GTK_CONTAINER(tabs), queue);
- /* Add queue to display */
- gtk_container_add(GTK_CONTAINER(notebook_box), queue);
- g_object_unref(queue);
+ gtk_window_resize(GTK_WINDOW(toplevel), mini_width, mini_height);
+ gtk_widget_hide(tabs);
+ gtk_widget_show(playing_mini);
+ }
+ xgettimeofday(&last_mode_switch, NULL);
+}
+
+/* Called when the window size is allocate */
+static void toplevel_size_allocate(GtkWidget attribute((unused)) *w,
+ GtkAllocation *a,
+ gpointer attribute((unused)) user_data) {
+ struct timeval now;
+ xgettimeofday(&now, NULL);
+ if(tvdouble(tvsub(now, last_mode_switch)) < 0.5) {
+ /* Suppress size-allocate signals that are within half a second of a mode
+ * switch: they are quite likely to be the result of re-arranging widgets
+ * within the old size, not the application of the new size. Yes, this is
+ * a disgusting hack! */
+ return; /* OMG too soon! */
+ }
+ if(full_mode) {
+ toplevel_width = a->width;
+ toplevel_height = a->height;
+ } else {
+ mini_width = a->width;
+ mini_height = a->height;