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

-------------

Commit messages:
 - 8352298: FileChooser: inconsistent behavior with setInitialName()

Changes: https://git.openjdk.org/jfx/pull/2096/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2096&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8352298
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jfx/pull/2096.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2096/head:pull/2096

PR: https://git.openjdk.org/jfx/pull/2096

Reply via email to