 
 (def old-bounds (atom {}))
 
-(def mac-new-toggle-full-screen
-  (attempt-eval
-    '(fn [window]
-       (.requestToggleFullScreen
-         (eval `(Application/getApplication)) window))
-    (constantly nil)))
+(attempt-defn mac-new-toggle-full-screen
+  [window]
+  (.requestToggleFullScreen
+    (Application/getApplication) window))
 
 (defn full-screen!
   "Make the given window/frame full-screen."

      (exit-full-screen! window)
      (full-screen! window))))

(defn attempt-eval [form default]
  (try
    (eval form)
    (catch Throwable _ default)))

(def new-mac-enable-full-screen
  (attempt-eval
    '(fn [window]
       (FullScreenUtilities/setWindowCanFullScreen window true)
       (FullScreenUtilities/addFullScreenListenerTo window
         (proxy [FullScreenAdapter] []

  (try
    (do (eval form) true)
    (catch Throwable _ false)))

(defn attempt-eval
  [form default]
  (try
    (eval form)
    (catch Throwable _ default)))

(defmacro attempt-defn [& body]
  `(attempt-eval
     '(defn ~@body)
     (def ~(first body) (constantly nil))))

(def new-mac-full-screen
  (can-eval? '(do (import com.apple.eawt.FullScreenUtilities)
