#ifdef OLD_FILESEL
char *filesel_name;
#endif
- int drawing_area_shrink_pending;
GSList *preset_radio;
int n_preset_menu_items;
int preset_threaded;
GtkWidget *preset_custom;
GtkWidget *copy_menu_item;
+#if !GTK_CHECK_VERSION(3,0,0)
+ int drawing_area_shrink_pending;
int menubar_is_local;
+#endif
};
struct blitter {
}
}
+#if !GTK_CHECK_VERSION(3,0,0)
static gboolean not_size_allocated_yet(GtkWidget *w)
{
/*
fe->drawing_area_shrink_pending = FALSE;
}
}
+#endif /* !GTK_CHECK_VERSION(3,0,0) */
static gint configure_window(GtkWidget *widget,
GdkEventConfigure *event, gpointer data)
{
- frontend *fe = (frontend *)data;
+#if !GTK_CHECK_VERSION(3,0,0)
/*
* When the main puzzle window changes size, it might be because
* the menu bar or status bar has turned up after starting off
* absent, in which case we should have another go at enacting a
* pending shrink of the drawing area.
*/
+ frontend *fe = (frontend *)data;
try_shrink_drawing_area(fe);
+#endif
return FALSE;
}
int x, y;
get_size(fe, &x, &y);
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_window_resize_to_geometry(GTK_WINDOW(fe->window), x, y);
+#else
fe->w = x;
fe->h = y;
fe->drawing_area_shrink_pending = FALSE;
}
fe->drawing_area_shrink_pending = TRUE;
try_shrink_drawing_area(fe);
+#endif
}
static void menu_preset_event(GtkMenuItem *menuitem, gpointer data)
midend_new_game(fe->me);
}
+#if !GTK_CHECK_VERSION(3,0,0)
{
/*
* try_shrink_drawing_area() will do some fiddling with the
fe->menubar_is_local = !unity_mode;
}
}
+#endif
fe->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(fe->window), thegame.name);
#if GTK_CHECK_VERSION(2,0,0)
gtk_widget_set_double_buffered(fe->area, FALSE);
#endif
+ {
+ GdkGeometry geom;
+ geom.base_width = geom.base_height = 0;
+ gtk_window_set_geometry_hints(GTK_WINDOW(fe->window), fe->area,
+ &geom, GDK_HINT_BASE_SIZE);
+ }
get_size(fe, &x, &y);
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_window_set_default_geometry(GTK_WINDOW(fe->window), x, y);
+#else
fe->drawing_area_shrink_pending = FALSE;
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
+#endif
fe->w = x;
fe->h = y;
gtk_widget_show(fe->area);
gtk_widget_show(fe->window);
+#if !GTK_CHECK_VERSION(3,0,0)
fe->drawing_area_shrink_pending = TRUE;
try_shrink_drawing_area(fe);
+#endif
+
set_window_background(fe, 0);
return fe;