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:
2026-04-30 23:16:41 +02:00
parent c2db35c6fc
commit 41cd0021b0
3 changed files with 11 additions and 6 deletions
+1 -3
View File
@@ -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)
+8 -1
View File
@@ -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
View File
@@ -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)