diff --git a/gtk/src/gtk_display_driver_opengl.cpp b/gtk/src/gtk_display_driver_opengl.cpp index bfcc01cd..043c2c3a 100644 --- a/gtk/src/gtk_display_driver_opengl.cpp +++ b/gtk/src/gtk_display_driver_opengl.cpp @@ -116,15 +116,17 @@ S9xOpenGLDisplayDriver::update (int width, int height) void *pboMemory = NULL; int x, y, w, h; - if (width <= 0) - { - gdk_window_hide (gdk_window); - return; - } - GtkAllocation allocation; gtk_widget_get_allocation (drawing_area, &allocation); +#if GTK_CHECK_VERSION(3,10,0) + int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); + + allocation.width *= gdk_scale_factor; + allocation.height *= gdk_scale_factor; + +#endif + if (output_window_width != allocation.width || output_window_height != allocation.height) { diff --git a/gtk/src/gtk_display_driver_xv.cpp b/gtk/src/gtk_display_driver_xv.cpp index 9b1b35fc..3e423b65 100644 --- a/gtk/src/gtk_display_driver_xv.cpp +++ b/gtk/src/gtk_display_driver_xv.cpp @@ -95,15 +95,17 @@ S9xXVDisplayDriver::update (int width, int height) GtkAllocation allocation; gtk_widget_get_allocation (drawing_area, &allocation); +#if GTK_CHECK_VERSION(3,10,0) + int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); + + allocation.width *= gdk_scale_factor; + allocation.height *= gdk_scale_factor; + +#endif + current_width = allocation.width; current_height = allocation.height; - if (width <= 0) - { - gdk_window_hide (gdk_window); - return; - } - if (output_window_width != current_width || output_window_height != current_height) { @@ -514,6 +516,13 @@ S9xXVDisplayDriver::clear (void) GC xgc = XDefaultGC (display, XDefaultScreen (display)); gtk_widget_get_allocation (drawing_area, &allocation); +#if GTK_CHECK_VERSION(3,10,0) + int gdk_scale_factor = gdk_window_get_scale_factor (gdk_window); + + allocation.width *= gdk_scale_factor; + allocation.height *= gdk_scale_factor; + +#endif width = allocation.width; height = allocation.height;