(define-method fix-widget-new-geometry-callback ((widget <glx-viewport>))
(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))))
(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))
(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