When should an interpreter issue arrange and redraw events?

I noticed a bug in Counterfeit Monkey (now fixed), which only manifests in Spatterlight and Windows Glulxe: After typing HELP and then closing the help menu with Q, the map will have the wrong size until you LOOK or resize the game window.

I haven’t looked into this very deeply, but the cause seems to be that the Menus extension used by the game expects an evtype_Arrange to be generated automatically when the help window is closed, which is something that happens on most interpreters, including Lectrote, which is usually pretty strict. If I’m reading the Glk specification correctly at https://eblong.com/zarf/glk/Glk-Spec-075.html#arrange_events, this is not actually according to spec:

A similar issue can be seen in Andromeda 1983: If the player makes the graphics window narrower and then wider, the right end of the image will be cut off and replaced by white on Spatterlight and WinGlulxe, but not on other interpreters. Here the cause seems to be that the game expects an evtype_Redraw whenever a window is resized by the player, which again happens on most interpreters, but not according to https://eblong.com/zarf/glk/Glk-Spec-075.html#window_graphics:

So I’d like to know what you think. Should I change Spatterlight to be more generous with the arrange and redraw events?

I suppose an ideal interpreter would have an internal list of games and the interpreter quirks they expect, and adapt its behaviour accordingly. But that would be a slightly bigger task.

Sigh. I don’t remember the logic (or lack thereof) that led Lectrote/Quixe to have that behavior.

I don’t think I ever intended it. In fact I don’t see how the evtype_Arrange gets in there. Maybe the “magic gameport resize detector” is too sensitive to DOM changes.

Gah. As usual, no good solutions.

Regardless of anything else, it would be good to fix the Menus extension.

I would like to fix the Lectrote/Quixe behavior, since it’s not spec. But (a) that’s low on my priority list, and (b) then some games stop working.

Therefore, it wouldn’t be unreasonable for you to adjust Spatterlight in that way. But make sure there’s a comment blaming me. :slight_smile:

I should probably clarify that this is all based on some very superficial investigation. Any claims made in my original post should be taken with a grain of salt.