gtk & cocoa: frame iconize repairs

In the "windowing.rktl" tests, for Gtk there are still race conditions
 between the program and the window manager. But for the first
 time ever, all platforms can pass the "windowing.rktl" test.
This commit is contained in:
Matthew Flatt 2010-11-26 08:30:50 -07:00
parent 43e25a83f2
commit 7da127227a
3 changed files with 21 additions and 9 deletions

View File

@ -520,7 +520,9 @@
(define/public (iconized?)
(tell #:type _BOOL cocoa isMiniaturized))
(define/public (iconize on?)
(tellv cocoa miniaturize: cocoa))
(if on?
(tellv cocoa miniaturize: cocoa)
(tellv cocoa deminiaturize: cocoa)))
(define/public (set-title s)
(tellv cocoa setTitle: #:type _NSString s))

View File

@ -180,6 +180,7 @@
(connect-delete gtk)
(connect-configure gtk)
(connect-focus gtk)
(connect-window-state gtk)
(define saved-title (or label ""))
(define is-modified? #f)
@ -311,6 +312,7 @@
(hash-set! all-frames this #t)
(hash-remove! all-frames this))
(super direct-show on?)
(when on? (gtk_window_deiconify gtk))
(register-frame-shown this on?))
(define/public (destroy)

View File

@ -30,6 +30,17 @@
(thread (lambda () (sleep 0.01) (semaphore-post s)))
(test s 'yield (yield s))))
(define (iconize-pause)
(if (eq? 'unix (system-type))
;; iconization might take a while
;; for the window manager to report back
(begin
(pause)
(when (regexp-match? #rx"darwin" (path->string (system-library-subpath)))
(sleep 0.75))
(pause))
(pause)))
(let ([s (make-semaphore 1)])
(test s 'yield-wrapped (yield s)))
(let ([s (make-semaphore 1)])
@ -256,21 +267,18 @@
(printf "Iconize\n")
(stv f iconize #t)
(pause)
(pause)
(iconize-pause)
(st #t f is-iconized?)
(stv f iconize #f)
(pause)
(pause)
(iconize-pause)
(st #f f is-iconized?)
(stv f iconize #t)
(pause)
(pause)
(iconize-pause)
(st #t f is-iconized?)
(stv f show #t)
(pause)
(iconize-pause)
(st #f f is-iconized?)
(stv f maximize #t)
(pause)
(stv f maximize #f)