Fix gdk_window_new already having applied device scale.

This commit is contained in:
Brandon Wright 2018-05-05 14:14:06 -05:00
parent 0c8ea1671d
commit 7566704e65
2 changed files with 15 additions and 16 deletions

View File

@ -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;

View File

@ -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];