Repository navigation
Conversation
The startup printer-status refresh runs before process_window_events(),
and every network wait drained and discarded the window's IDCMP
messages. With the saved printer switched off, close-gadget clicks were
thrown away until every retry timed out, and a saved "ip:631" endpoint
made perform_query_flow() try port 631 twice over.
- Route the Query's message drains through mp_pump_gui_during_query(),
which still replies to everything but records IDCMP_CLOSEWINDOW (cancel
and quit) and Ctrl-C (cancel). Connect, receive and the retry loop stop
on cancel; query_printer_attributes() returns -3 for it.
- A port hint of 631 is now tried on its own instead of {631, 631}.
- After a failed or cancelled Query, reload the endpoint's capability
cache so the lists match the dropdowns still on screen.
- Bump MintPrint Settings to 1.3.4 with release notes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EJn7USrjfyvMsbkXBQ7rEp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A user reported this: after connecting once, they reopened MintPrint Settings with the printer switched off. The window seemed stuck in a loop looking for the printer, and they couldn't quit.
Cause:
main()runs the startup printer-status refresh (perform_query_flow_allocated) beforeprocess_window_events()starts.mp_connect_with_timeout,query_printer_attributessend/receive/parse) drained the window's IDCMP port withGT_GetIMsg/GT_ReplyIMsgand discarded each message. Close-gadget clicks were lost.ip:631. On the next start,port_hint == 631produced the port list{631, 631}: two attempts each at 8 s, so 4 × 8 s ≈ 32 s of "Trying …:631 (attempt n/3)" lines. On a stack whereFIONBIOfails, the code falls back to a blockingconnect(), which can take minutes.Changes
mp_pump_gui_during_query()replaces the five drain loops. It still replies to every message, but recordsIDCMP_CLOSEWINDOW(cancel + quit) and Ctrl-C (cancel only).EINTRon cancel. The receive loop stops andquery_printer_attributes()returns the new-3. Theperform_query_flow()retry loops stop too.process_window_events()exits straight away if a close arrived during the startup refresh or during a Query started from a button.{631, 631}. Explicit non-631 hints and the no-hint case are unchanged.query_printer_attributes()empties thenum_supported_*lists before connecting, so with the printer off they no longer matched the dropdowns still on screen. Ink levels aren't cached, so they stay cleared as before.MINTPRINT_SETTINGS_VERSION, the$VERdate (23.10.2026), a CHANGELOG entry, and the README / Aminet readme "What's new" sections.Not changed
connect()fallback used whenIoctlSocket(FIONBIO)fails still can't be interrupted.Testing
make -k checklocally: every host suite passes.test-postscriptcouldn't run here because Ghostscript isn't installed; CI installs it. These suites don't coverMintPrintSettings.c.make guibuild and a check on real hardware:ip:631is saved.Generated by Claude Code