]> gitweb.factorcode.org Git - factor.git/commitdiff
set first responder on cocoa view back when returning from fullscreen mode. un-fullsc...
authorJoe Groff <arcata@gmail.com>
Thu, 14 May 2009 22:29:25 +0000 (17:29 -0500)
committerJoe Groff <arcata@gmail.com>
Thu, 14 May 2009 22:29:25 +0000 (17:29 -0500)
basis/ui/backend/cocoa/cocoa.factor

index 73eff252405230a3ca8ebdd501d52daf6c76fcbf..b6c9b4327120ec7b50aa1f13e1db823fcafe3426 100755 (executable)
@@ -99,7 +99,9 @@ M: cocoa-ui-backend set-title ( string world -- )
     drop ;
 
 : exit-fullscreen ( world -- )
-    handle>> view>> f -> exitFullScreenModeWithOptions: ;
+    handle>>
+    [ view>> f -> exitFullScreenModeWithOptions: ] 
+    [ [ window>> ] [ view>> ] bi -> makeFirstResponder: drop ] bi ;
 
 M: cocoa-ui-backend (set-fullscreen) ( world ? -- )
     [ enter-fullscreen ] [ exit-fullscreen ] if ;
@@ -120,7 +122,11 @@ M:: cocoa-ui-backend (open-window) ( world -- )
     window f -> makeKeyAndOrderFront: ;
 
 M: cocoa-ui-backend (close-window) ( handle -- )
-    window>> -> release ;
+    [
+        view>> dup -> isInFullScreenMode zero?
+        [ drop ]
+        [ f -> exitFullScreenModeWithOptions: ] if
+    ] [ window>> -> release ] bi ;
 
 M: cocoa-ui-backend (grab-input) ( handle -- )
     0 CGAssociateMouseAndMouseCursorPosition drop