Skip to content

fix(services)!: name the message box's buttons a choice, not a set - #489

Merged
siracozmen01 merged 1 commit into
mainfrom
message-choice
Nov 5, 2026
Merged

siracozmen01 merged 1 commit into
mainfrom
message-choice

Conversation

@siracozmen01

Copy link
Copy Markdown
Contributor

Problem

mwinMessageButtons in include/maul-window/services.h is the only plural typedef in the API that is a choice rather than a set of flags. It is an int32_t with mwin_buttonsOk, mwin_buttonsOkCancel and mwin_buttonsYesNo, held by mwinMessageBoxDef.buttons. Every other plural (mwinModifiers, mwinMouseButtons, mwinGamepadButtons, mwinDragContents, mwinPenFlags) is a uint32_t set of flags, so def.buttons = mwin_buttonsOk reads as a set of buttons.

Change

  • The type becomes mwinMessageChoice.
  • Its constants become mwin_choiceOk, mwin_choiceOkCancel and mwin_choiceYesNo. They take the type's last word, as mwin_purpose* does for mwinInputPurpose. That keeps them apart from mwinMessageKind's mwin_message* constants: both types are int32_t, so one passed for the other would compile.
  • The mwinMessageBoxDef field becomes choice.
  • Every backend's message box and its tests read the new field. docs/user/services.md now says a message box has "a choice of buttons".
  • No name in the API started with mwin_choice or was mwinMessageChoice before.

Verification

  • Built with no errors or warnings: the gcc-14 tree, the clang-20 ASan, minimal and fuzz trees, MinGW, wasm32-wasi and Android.
  • The macOS and iOS files (src/macos_message_box.m, src/ios_message_box.m, test/test_macos_dialog.m, test/test_ios_services.m) change only in the names, and clang-format has nothing to change in them. Their CI cells build and run them.
  • tools/check.sh changed passes, the kinds and message_box suites included.
  • In the CI image, x11_message_box passes on the build's own Xvfb, and web_services passes in headless Chrome on the web-wasi build.
  • test_win32_message_box.exe passes under Wine. Only the Windows CI runner runs it on Windows itself.

BREAKING CHANGE: mwinMessageButtons is now mwinMessageChoice, its constants mwin_buttonsOk, mwin_buttonsOkCancel and mwin_buttonsYesNo are now mwin_choiceOk, mwin_choiceOkCancel and mwin_choiceYesNo, and mwinMessageBoxDef.buttons is now mwinMessageBoxDef.choice.
Closes #487

@siracozmen01 siracozmen01 added the bug Something does not work as documented label Nov 5, 2026

@siracozmen01 siracozmen01 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review at 7d9ea5e: ready, with one point not verified. No findings. Read, not run.

  • include/maul-window/services.h at the head has the type mwinMessageChoice (line 106), the constants mwin_choiceOk/OkCancel/YesNo with the same values 0, 1 and 2, the field choice (130), and the inline default def.choice = mwin_choiceOk (155). Nothing in the header still says mwinMessageButtons, mwin_buttons or .buttons for the box.
  • docs/user/services.md says "a choice of buttons" and names no old identifier.
  • The 16 files change only the names. The backends (message_box.c, posix, x11, web, win32, and the macOS and iOS .m files) read def->choice and compare with mwin_choice*. The values are unchanged, so no switch moves.
  • Type: the second read of #371 filed #483 as a rename for clarity, and it landed as fix(input)! (#485). This one comes from the same read's questions, so fix(services)! follows that precedent. The first read's renames (#384 to #394) were refactor!. In 0.x either one bumps the minor through !, and fix puts the entry under Bug Fixes, where it is visible, which suits a rename users must act on.
  • The BREAKING CHANGE footer names all three renames.

Not verified: leftovers outside the 16 files. I can only read the files the diff touches and the ones I fetch, not search the tree. A search over the whole repository at this head for mwinMessageButtons, mwin_buttonsOk, mwin_buttonsOkCancel, mwin_buttonsYesNo and \.buttons\b near a message box would settle it, including samples/, any bindings, java/ and docs/. The build covers C and the .m files the CI cells compile, but not docs, samples outside the build, or Java strings.

@siracozmen01
siracozmen01 merged commit c1ba373 into main Nov 5, 2026
44 checks passed
@siracozmen01
siracozmen01 deleted the message-choice branch November 5, 2026 12:30
@rawframe-release rawframe-release Bot mentioned this pull request Nov 5, 2026
siracozmen01 pushed a commit that referenced this pull request Nov 5, 2026
🤖 I have created a release *beep* *boop*
---


## [0.15.0](v0.14.0...v0.15.0) (2026-11-05)

The iOS device check, that a window shows no flash against the launch
screen before its first frame, is waived by the owner for this
release, which ships on the iOS simulator suite: its iOS changes leave
the launch and the first frame alone.

### Changed

- **Breaking:** `mwinMessageButtons` is now `mwinMessageChoice`, its
  constants `mwin_buttonsOk`, `mwin_buttonsOkCancel` and
  `mwin_buttonsYesNo` are now `mwin_choiceOk`, `mwin_choiceOkCancel`
  and `mwin_choiceYesNo`, and `mwinMessageBoxDef.buttons` is now
  `mwinMessageBoxDef.choice`. The type is a choice of one, but its
  plural name read as a set of flags, as every other plural type in
  the API is
  ([#489](#489)).
- **Breaking:** the test platform's `mwinGamepad_GetTestRumble` and
  `mwinGamepad_GetTestTriggerRumble` take `size_t* countOut` instead
  of `uint32_t* countOut`, as every other count the API reports is a
  `size_t`
  ([#490](#490)).
- Maul Window builds against Maul Unicode 1.2.0, which gives the
  results 1.1.2 gave, so nothing a program gets from Maul Window
  changes. The installed CMake config and pkg-config file ask for
  Maul Unicode 1.2.0, and a build on a machine with only Maul Unicode
  1.1.2 installed fetches 1.2.0 instead of using it
  ([#493](#493)).

### Fixed

- On Windows, a generic HID gamepad with more than 64 buttons down at
  once, such as a stick or button box of 128 whose toggle switches
  stay down, reads its buttons. Before, the library asked Windows'
  parser for the buttons down with room for 64, the parser refused,
  and the report's buttons were dropped: each button kept the state of
  the last report that listed 64 or fewer, and a press or a release in
  between was lost
  ([#495](#495)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something does not work as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mwinMessageButtons reads as a set of flags but is a choice

1 participant