racket / htdp

Other
91 stars 69 forks source link

closing window under stepper does not show "Program is Gone" message #209

Closed jbclements closed 7 months ago

jbclements commented 10 months ago

In testing the release candidate 8.10.900, I discover that starting the stepper and then closing the tab containing the stepped window no longer triggers the "The Program is Gone" error message in the stepper window.

I'm in the process of investigating this, but my guess is that something has changed in or around the gui framework or the framework classes that have altered the ability to catch a closing event by augmenting the "on-close" method of a tab. Specifically, I'm doing it like this:

;; stepper-tab-mixin : the mixin that is applied to drracket tabs, to
;; interact with a possible stepper window.
(define (stepper-tab-mixin super%)
  (class* super% (stepper-tab<%>)

    (inherit get-ints get-defs get-frame get-directory)
...
    (define/augment (on-close)
      (when stepper-frame
        (send stepper-frame original-program-gone))
      (inner (void) on-close))

and this is what happens on a frame close, though I don't think this is relevant:

(define (stepper-unit-frame-mixin super%)
  (class* super% ()
    (inherit get-button-panel register-toolbar-button get-current-tab get-tabs)

    ;; when the window closes, notify all of the stepper frames.
    (define/augment (on-close)
      (for ([tab (in-list (get-tabs))])
        (define possible-stepper-frame (send tab get-stepper-frame))
        (when possible-stepper-frame
          (send possible-stepper-frame original-program-gone)))
      (inner (void) on-close))

The "The Program has Changed" message still works fine, so it seems unlikely to be a problem with displaying the banner.

There are no changes to the stepper code this year (sigh...) so it seems like something must have changed outside the stepper? Are there any obvious changes to the on-close method?

To see if I could guess what is causing this, I took a quick look at the commits to racket/htdp and racket/gui, and didn't see much. About the most promising one I saw was https://github.com/racket/gui/commit/2d1b2cd8 , but ... that still doesn't seem very promising.

rfindler commented 9 months ago

I think this is fixed now.

jbclements commented 7 months ago

@rfindler Indeed! Thanks so much!