On Thu, 5 Mar 2026 18:02:50 GMT, Dmitry Markov <[email protected]> wrote:
> In `MacCommonDialogs__showFileSaveChooser`, we pre-populate the Save dialog > name field using: `setNameFieldStringValue`. > After that `DialogDispatcher applyExtensions(...)` is invoked. > applyExtensions builds the extension filters, selects the default filter and > immediately calls `extensionFilterChanged`. That callback reconfigures the > `NSSavePanel` allowed types for the selected filter. If the initial filename > already contains an extension (e.g. _file.rich_) and the selected filter also > enforces that extension (_rich_), the panel effectively appends the extension > again resulting in the UI showing _file.rich.rich_. This is especially > visible for non-standard extensions like ._rich_.The ._txt_ often appears > “normal” because macOS handles known extensions and “hide extension” > presentation. > > Fix: > Always pre-fill the name field with a base name only (no extension) and let > the panel/filter selection supply the extension The fix works as expected, thanks! Side note: I have no idea how to force a specific file name on macOS, i.e. a name without extension, or with a different extension. I suppose the only way is to rename the file in the Finder. But this is a mac problem. Could someone with native macOS expertise take a look at this please? ------------- Marked as reviewed by angorya (Reviewer). PR Review: https://git.openjdk.org/jfx/pull/2096#pullrequestreview-3899048408
