From 3f4302e948ce0c2bcad6633029389d6e6c6daf66 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 16 Aug 2015 19:40:49 -0600 Subject: [PATCH] hide editor-canvas%'s => blink timer expires Ensure that a blink timer for a canvas stops running if the canvas becomes hidden. Otherwise, though a race condition, it's possible for a GUI program to never terminate if a "focus-out" event gets lost. --- gui-lib/mred/private/wxme/editor-canvas.rkt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui-lib/mred/private/wxme/editor-canvas.rkt b/gui-lib/mred/private/wxme/editor-canvas.rkt index f05a6e8d..0dab8ac9 100644 --- a/gui-lib/mred/private/wxme/editor-canvas.rkt +++ b/gui-lib/mred/private/wxme/editor-canvas.rkt @@ -92,7 +92,9 @@ (define/override (notify) (when canvas - (send canvas blink-caret))) + (if (send canvas is-shown-to-root?) + (send canvas blink-caret) + (kill)))) (define/public (kill) (set! canvas #f) @@ -144,7 +146,7 @@ (append (if (or (memq 'no-hscroll style) (memq 'hide-hscroll style)) - null + null '(hscroll)) (if (or (memq 'no-vscroll style) (memq 'hide-vscroll style))