From 92824b3a1302768e10e9aaf5d477c9a23759e879 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 7 Jun 2018 16:33:32 -0700 Subject: [PATCH] gl: Pass GdkWindow, not an XID, to gdk_window_get_scale_factor. --- src/gl/gl-glx.scm | 10 +++++----- src/gl/gl.cdecl | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gl/gl-glx.scm b/src/gl/gl-glx.scm index 11de2df14..b486377ca 100644 --- a/src/gl/gl-glx.scm +++ b/src/gl/gl-glx.scm @@ -231,10 +231,10 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define-method fix-widget-new-geometry-callback ((widget )) (call-next-method widget) - (let ((xwindow (glx-widget-xwindow widget))) - (if xwindow - (let ((geometry (fix-widget-geometry widget)) - (scale (C-call "gdk_window_get_scale_factor" xwindow))) + (if (glx-widget-xwindow widget) + (let ((geometry (fix-widget-geometry widget)) + (scale (C-call "gdk_window_get_scale_factor" + (fix-widget-window widget)))) (let ((w (fix:* scale (fix-rect-width geometry))) (h (fix:* scale (fix-rect-height geometry)))) (let ((aspect (->flonum (/ w h)))) @@ -246,7 +246,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (glu:perspective (glx-viewport-fovy widget) aspect (glx-viewport-near widget) - (glx-viewport-far widget)))))))))) + (glx-viewport-far widget))))))))) (define (draw-callback widget cr) (declare (ignore cr)) diff --git a/src/gl/gl.cdecl b/src/gl/gl.cdecl index 5b5a3e9d0..298cf278f 100644 --- a/src/gl/gl.cdecl +++ b/src/gl/gl.cdecl @@ -335,6 +335,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (widget (* GtkWidget)) (window (* GdkWindow))) +(extern gint gdk_window_get_scale_factor + (window (* GdkWindow))) + (enum (GDK_ALL_EVENTS_MASK)) #;(extern (* GdkPixbuf) gdk_pixbuf_xlib_get_from_drawable -- 2.25.1