diff --git a/desmume/configure.ac b/desmume/configure.ac index e70231df8..6e3d891cd 100644 --- a/desmume/configure.ac +++ b/desmume/configure.ac @@ -120,7 +120,7 @@ dnl - Check for GTK and/or libglade FOUND_GLIB=no HAVE_ALSA=no GLIB_VER=2.8 -GTK_VER=2.10 +GTK_VER=2.14 AC_CHECK_TOOL(HAVE_PKG, pkg-config) AC_PROVIDE_IFELSE([PKG_PROG_PKG_CONFIG], [ if test ! "x$HAVE_PKG" = "x" ; then diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index a958e0c5e..6dc15c062 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -1150,18 +1150,19 @@ static gboolean ExposeDrawingArea (GtkWidget *widget, GdkEventExpose *event, gpo GdkPixbuf *resizedPixbuf, *drawPixbuf; guchar rgb[SCREENS_PIXEL_SIZE*SCREEN_BYTES_PER_PIXEL]; cairo_t *cr; + GdkWindow *window; gfloat vratio, hratio, nscreen_ratio; gint daW, daH, imgW, imgH, screenW, screenH, gapW, gapH; gint primaryOffsetX, primaryOffsetY, secondaryOffsetX, secondaryOffsetY; const gboolean gap_vertical = ((nds_screen.orientation == ORIENT_VERTICAL) ^ (nds_screen.rotation_angle == 90 || nds_screen.rotation_angle == 270)); -#if GTK_CHECK_VERSION(2,14,0) - gdk_drawable_get_size( - gtk_widget_get_window(GTK_WIDGET(pDrawingArea)), &daW, &daH); + window = gtk_widget_get_window(GTK_WIDGET(pDrawingArea)); +#if GTK_CHECK_VERSION(2,24,0) + daW = gdk_window_get_width(window); + daH = gdk_window_get_height(window); #else - gdk_drawable_get_size( - (GTK_WIDGET(pDrawingArea))->window, &daW, &daH); + gdk_drawable_get_size(window, &daW, &daH); #endif if (nds_screen.rotation_angle == 0 || nds_screen.rotation_angle == 180) {