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)
|
(unless (eq? counter-thread #f)
|
||||||
(send this message 'warning "Cannot close window"
|
(send this message 'warning "Cannot close window"
|
||||||
"Cannot close this window while the counter runs"))
|
"Cannot close this window while the counter runs"))
|
||||||
(if (eq? counter-thread #f)
|
(eq? counter-thread #f))
|
||||||
(super can-close?)
|
|
||||||
#f))
|
|
||||||
|
|
||||||
(define start-stop-btn #f)
|
(define start-stop-btn #f)
|
||||||
|
|
||||||
|
|||||||
@@ -746,7 +746,14 @@
|
|||||||
|
|
||||||
(define (rkt-webview-close handle)
|
(define (rkt-webview-close handle)
|
||||||
(rkt_webview_close (rkt-wv-win 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)
|
(set-rkt-wv-valid! handle #f)
|
||||||
(hash-remove! evt-cb-hash (rkt-wv-win handle))
|
(hash-remove! evt-cb-hash (rkt-wv-win handle))
|
||||||
(hash-remove! rkt-wv-store (rkt-wv-win handle))
|
(hash-remove! rkt-wv-store (rkt-wv-win handle))
|
||||||
|
|||||||
+2
-2
@@ -248,11 +248,11 @@
|
|||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define/public (can-close?)
|
(define/public (can-close?)
|
||||||
(when quit-on-close
|
|
||||||
(send this quit))
|
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define/public (closed)
|
(define/public (closed)
|
||||||
|
(when quit-on-close
|
||||||
|
(send this quit))
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define/public (js-event js-event)
|
(define/public (js-event js-event)
|
||||||
|
|||||||
Reference in New Issue
Block a user