Revert "another attempt to fix the 64-bit Lion hidden-window problem"

This reverts commit f6e5468dbb85c2ed48178ac43fb25084430413ef.

Merge to 5.2

original commit: 9fd11ac92cec38a0497ae155f472ab82cca97a2b
This commit is contained in:
Matthew Flatt 2011-10-10 15:38:42 -06:00
parent 85af4802de
commit 8da2243aeb
3 changed files with 15 additions and 52 deletions

View File

@ -91,8 +91,6 @@
(let ([front (get-front)]
[parent (and (version-10.6-or-later?)
parent)])
(call-in-run-loop
(lambda ()
(when parent
(tellv ns beginSheetModalForWindow: (send parent get-cocoa-window)
completionHandler: #f))
@ -100,7 +98,7 @@
(tell #:type _NSInteger ns runModal)
(when parent (tell app endSheet: ns))
(when front (tellv (send front get-cocoa-window)
makeKeyAndOrderFront: #f)))))))])
makeKeyAndOrderFront: #f)))))])
(begin0
(if (zero? result)
#f

View File

@ -16,8 +16,7 @@
"bitmap.rkt"
"cg.rkt"
"utils.rkt"
"types.rkt"
"queue.rkt")
"types.rkt")
(provide
(protect-out printer-dc%
@ -106,10 +105,8 @@
(if (atomically
(let ([front (get-front)])
(begin0
(call-in-run-loop
(lambda ()
(= (tell #:type _NSInteger (tell NSPageLayout pageLayout) runModalWithPrintInfo: print-info)
NSOkButton)))
NSOkButton)
(when front
(tellv (send front get-cocoa-window) makeKeyAndOrderFront: #f)))))
(begin

View File

@ -21,7 +21,6 @@
set-menu-bar-hooks!
set-fixup-window-locations!
post-dummy-event
call-in-run-loop
try-to-sync-refresh
sync-cocoa-events)
@ -31,8 +30,7 @@
queue-event
yield)
(import-class NSApplication NSAutoreleasePool NSColor NSProcessInfo NSArray
NSRunLoop)
(import-class NSApplication NSAutoreleasePool NSColor NSProcessInfo NSArray)
(import-protocol NSApplicationDelegate)
;; Extreme hackery to hide original arguments from
@ -80,11 +78,7 @@
(queue-file-event (string->path filename))]
[-a _void (applicationDidFinishLaunching: [_id notification])
(unless got-file?
(queue-start-empty-event))
(tellv app stop: self)]
[-a _void (callbackAndStopLoop)
(run-loop-callback)
(tellv app stop: self)]
(queue-start-empty-event))]
[-a _BOOL (applicationShouldHandleReopen: [_id app] hasVisibleWindows: [_BOOL has-visible?])
;; If we have any visible windows, return #t to do the default thing.
;; Otherwise return #f, because we don't want any invisible windows resurrected.
@ -138,34 +132,7 @@
(unless (zero? v)
(log-error (format "error from CGDisplayRegisterReconfigurationCallback: ~a" v))))
;; To make sure that `finishLaunching' is called, call `run'
;; and have `applicationDidFinishLaunching' quit the run loop.
;; This seems to work better than calling `finishLaunching'
;; directly undet 64-bt Lion, where calling just `finishLaunching'
;; somehow doesn't get the start-up AppleEvents.
(tellv app run)
;; Use `call-in-run-loop' to run something that needs to be
;; within `run', such as a modal-dialog run loop. It starts
;; a `run' with a high-priority callback to run `thunk', and
;; the run loop is stopped immediately after `thunk' returns.
(define (call-in-run-loop thunk)
(define result #f)
(set! run-loop-callback
(lambda ()
(set! run-loop-callback void)
(set! result (thunk))))
(tellv (tell NSRunLoop currentRunLoop)
performSelector: #:type _SEL (selector callbackAndStopLoop)
target: app-delegate
argument: #f
order: #:type _NSUInteger 0
modes: (tell NSArray
arrayWithObjects: #:type (_vector i _id) (vector NSDefaultRunLoopMode)
count: #:type _NSUInteger 1))
(tellv app run)
result)
(define run-loop-callback void)
(tellv app finishLaunching)
;; ------------------------------------------------------------
;; Create an event to post when MzScheme has been sleeping but is
@ -254,6 +221,7 @@
(define kCFSocketReadCallBack 1)
(import-class NSRunLoop)
(let* ([rl (tell #:type _CFRunLoopRef (tell NSRunLoop currentRunLoop) getCFRunLoop)]
[cfs (CFSocketCreateWithNative (CFAllocatorGetDefault) ready_sock kCFSocketReadCallBack
socket_callback sock-context)]