From: Matt Birkholz Date: Thu, 7 Jun 2018 23:33:32 +0000 (-0700) Subject: gl: Pass GdkWindow, not an XID, to gdk_window_get_scale_factor. X-Git-Tag: mit-scheme-pucked-gl-0.5~1 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=92824b3a1302768e10e9aaf5d477c9a23759e879;p=mit-scheme.git gl: Pass GdkWindow, not an XID, to gdk_window_get_scale_factor. --- 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