mirror of
https://github.com/libretro/snes9x.git
synced 2024-12-12 19:22:27 +00:00
Fix sizing when using GDK hidpi scaling with OpenGL or Xv.
This commit is contained in:
parent
fe55308901
commit
17f83a0806
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user