make sure the "closed" event comes. It will not come from the C backend, so we generate it in the racket-webview-qt.rkt module"
This commit is contained in:
@@ -113,9 +113,7 @@
|
||||
(unless (eq? counter-thread #f)
|
||||
(send this message 'warning "Cannot close window"
|
||||
"Cannot close this window while the counter runs"))
|
||||
(if (eq? counter-thread #f)
|
||||
(super can-close?)
|
||||
#f))
|
||||
(eq? counter-thread #f))
|
||||
|
||||
(define start-stop-btn #f)
|
||||
|
||||
|
||||
@@ -746,7 +746,14 @@
|
||||
|
||||
(define (rkt-webview-close handle)
|
||||
(rkt_webview_close (rkt-wv-win handle))
|
||||
;(enqueue! (rkt-wv-evt-queue handle) 'quit)
|
||||
(let ((evt-cb (hash-ref evt-cb-hash (rkt-wv-win handle) (λ args #t))))
|
||||
(let ((evt (format
|
||||
(string-append "{ \"event\": \"closed\", "
|
||||
" \"elaped\": -1.0, "
|
||||
" \"evt-id\": -98832, "
|
||||
" \"timestamp\": ~a }")
|
||||
(current-milliseconds))))
|
||||
(evt-cb evt)))
|
||||
(set-rkt-wv-valid! handle #f)
|
||||
(hash-remove! evt-cb-hash (rkt-wv-win handle))
|
||||
(hash-remove! rkt-wv-store (rkt-wv-win handle))
|
||||
|
||||
+2
-2
@@ -248,11 +248,11 @@
|
||||
#t)
|
||||
|
||||
(define/public (can-close?)
|
||||
(when quit-on-close
|
||||
(send this quit))
|
||||
#t)
|
||||
|
||||
(define/public (closed)
|
||||
(when quit-on-close
|
||||
(send this quit))
|
||||
#t)
|
||||
|
||||
(define/public (js-event js-event)
|
||||
|
||||
Reference in New Issue
Block a user