Let it compile with Gtk+ < 2.14

This commit is contained in:
Pierre Pronchery 2009-08-30 02:48:58 +00:00
parent fef4563122
commit bf17298140

View File

@ -208,9 +208,13 @@ static GtkWidget * _new_image(View * view, char const * path)
ph = gdk_pixbuf_get_height(pixbuf) + 4; ph = gdk_pixbuf_get_height(pixbuf) + 4;
/* get the current monitor size */ /* get the current monitor size */
screen = gdk_screen_get_default(); screen = gdk_screen_get_default();
#if GTK_CHECK_VERSION(2, 14, 0)
gtk_widget_realize(view->window); gtk_widget_realize(view->window);
monitor = gdk_screen_get_monitor_at_window(screen, monitor = gdk_screen_get_monitor_at_window(screen,
gtk_widget_get_window(view->window)); gtk_widget_get_window(view->window));
#else
monitor = 0; /* FIXME hard-coded */
#endif
gdk_screen_get_monitor_geometry(screen, monitor, &rect); gdk_screen_get_monitor_geometry(screen, monitor, &rect);
/* set an upper bound to the size of the window */ /* set an upper bound to the size of the window */
gtk_widget_set_size_request(window, min(pw, rect.width), min(ph, gtk_widget_set_size_request(window, min(pw, rect.width), min(ph,