Skip to content

Commit

Permalink
Fix compatibility with modern JVMs
Browse files Browse the repository at this point in the history
  • Loading branch information
eerohele committed Apr 8, 2024
1 parent b819459 commit 5b0ad5b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
1 change: 1 addition & 0 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:main clooj.core
:jvm-opts ["--add-exports" "java.desktop/com.apple.eawt=ALL-UNNAMED"]
:dependencies [[org.clojure/clojure "1.11.1"]
[clj-inspector "0.0.16"]
[slamhound "1.5.5"]
Expand Down
29 changes: 3 additions & 26 deletions src/clooj/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@
(try (Class/forName class-name)
(catch Throwable _ nil)))

(defn static-method [class-name method-name & arg-types]
(let [method
(some-> class-name
class-for-name
(.getMethod method-name
(into-array Class arg-types)))]
(fn [& args]
(.invoke method nil (object-array args)))))

;; preferences

;; define a UUID for clooj preferences
Expand Down Expand Up @@ -570,23 +561,9 @@

;; OS-specific utils

(defn enable-mac-fullscreen
(defmacro enable-mac-fullscreen
"Shows the Mac full-screen double arrow, as introduced in
OS X Lion, if possible."
[window]
(when (is-mac)
(let [enable (static-method
"com.apple.eawt.FullScreenUtilities"
"setWindowCanFullScreen"
java.awt.Window
Boolean/TYPE)]
(enable window true))))









(when (is-mac)
`(com.apple.eawt.FullScreenUtilities/setWindowCanFullScreen ~window true)))

0 comments on commit 5b0ad5b

Please sign in to comment.