gui/gui-lib/mred/private/wx/gtk/gtk3.rkt
Matthew Flatt 2a0fc3652f Gtk+ 3: open library in "global" mode to support the printer dialog
Opening a shared object in global mode risks conflicts with
other shared objects, but opening only one library that way
will hopefully not create conflicts.

(cherry picked from commit b29a7ae399)
2015-11-19 12:05:46 -07:00

19 lines
472 B
Racket

#lang racket/base
(require ffi/unsafe)
(provide gtk3?
get-gdk3-lib
get-gtk3-lib)
(define (get-gdk3-lib)
(ffi-lib "libgdk-3" '("0" "") #:fail (lambda () #f)))
(define (get-gtk3-lib)
;; Open in "global" mode so that gtk_print_operation_run()
;; can find the printer dialog using _g_module_symbol():
(ffi-lib "libgtk-3" '("0" "") #:global? #t #:fail (lambda () #f)))
(define gtk3?
(and (not (getenv "PLT_GTK2"))
(get-gdk3-lib)
(get-gtk3-lib)))