diff --git a/gtk/src/gtk_display_driver_opengl.cpp b/gtk/src/gtk_display_driver_opengl.cpp index f8c3da0c..2eace60d 100644 --- a/gtk/src/gtk_display_driver_opengl.cpp +++ b/gtk/src/gtk_display_driver_opengl.cpp @@ -119,6 +119,12 @@ S9xOpenGLDisplayDriver::update (int width, int height, int yoffset) GtkAllocation allocation; gtk_widget_get_allocation (drawing_area, &allocation); + if (output_window_width != allocation.width || + output_window_height != allocation.height) + { + resize_window (allocation.width, allocation.height); + } + #if GTK_CHECK_VERSION(3,10,0) int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); @@ -127,12 +133,6 @@ S9xOpenGLDisplayDriver::update (int width, int height, int yoffset) #endif - if (output_window_width != allocation.width || - output_window_height != allocation.height) - { - resize_window (allocation.width, allocation.height); - } - GLint filter = config->bilinear_filter ? GL_LINEAR : GL_NEAREST; glTexParameteri (tex_target, GL_TEXTURE_MAG_FILTER, filter); glTexParameteri (tex_target, GL_TEXTURE_MIN_FILTER, filter); @@ -788,8 +788,7 @@ S9xOpenGLDisplayDriver::init_glx (void) if (!glx_context) { XFreeColormap (display, xcolormap); - g_object_unref (gdk_window); - XDestroyWindow (display, xwindow); + gdk_window_destroy (gdk_window); fprintf (stderr, _("Couldn't create an OpenGL context.\n")); return 0; @@ -799,8 +798,7 @@ S9xOpenGLDisplayDriver::init_glx (void) { XFreeColormap (display, xcolormap); g_object_unref (gdk_window); - XDestroyWindow (display, xwindow); - glXDestroyContext (display, glx_context); + gdk_window_destroy (gdk_window); fprintf (stderr, "glXMakeCurrent failed.\n"); return 0; diff --git a/gtk/src/gtk_display_driver_xv.cpp b/gtk/src/gtk_display_driver_xv.cpp index 849a84f1..00d0d102 100644 --- a/gtk/src/gtk_display_driver_xv.cpp +++ b/gtk/src/gtk_display_driver_xv.cpp @@ -80,6 +80,13 @@ S9xXVDisplayDriver::update (int width, int height, int yoffset) GtkAllocation allocation; gtk_widget_get_allocation (drawing_area, &allocation); + + if (output_window_width != allocation.width || + output_window_height != allocation.height) + { + resize_window (allocation.width, allocation.height); + } + #if GTK_CHECK_VERSION(3,10,0) int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); @@ -91,12 +98,6 @@ S9xXVDisplayDriver::update (int width, int height, int yoffset) current_width = allocation.width; current_height = allocation.height; - if (output_window_width != current_width || - output_window_height != current_height) - { - resize_window (current_width, current_height); - } - if (config->scale_method > 0) { uint8 *src_buffer = (uint8 *) padded_buffer[0];