rnote icon indicating copy to clipboard operation
rnote copied to clipboard

file dialog filters not working as expected

Open Doublonmousse opened this issue 1 year ago • 2 comments

Describe the bug

After #1075, filters still don't work as expected.

On windows, applying the filters make gtk not even use the windows native file picker https://gitlab.gnome.org/GNOME/gtk/-/issues/6717.

On linux, the filter appears but you can still save a file without the file extension. The filename portion is the only part selected so it's harder to achieve but is still possible. image

Expected behavior
Have the filter work in a way that makes it impossible to have a filename saved without any extensions and using the native file picker on all platforms.

Libreoffice works around this by adding themselves the .odt if the extension is not there in the file picker Screenshot 2024-06-08 105938

One issue on the gtk repo talks about this issue as well https://gitlab.gnome.org/GNOME/gtk/-/issues/5367

To have something that uses the native file picker everywhere, no mime type nor custom filters can be used. Now the question is whether using add_pattern over add_mime_type will work

Desktop (please complete the following information):

  • OS: Windows 11 23H2, fedora 40
  • App Version: rnote main (post #1075)
  • Installation Source: from source
  • Desktop Environment: KDE 6 on linux
  • Display Server: wayland on linux

Doublonmousse avatar Jun 08 '24 09:06 Doublonmousse

Edit : with filter.add_pattern only, this seems to work.

This also works with filter.add_pattern and filter.add_suffix. (although the extension is shown twice in that case)

The extension is added automatically on windows with the native file picker and the file filter is shown as well.

I might try to use only patterns or patterns+suffix everywhere and removing all mimetypes, test on Windows (this should work), then on the other twos (linux + mac) to see

Doublonmousse avatar Jun 08 '24 10:06 Doublonmousse

Thanks for investigating this so thoroughly and reporting the issue upstream!

Hopefully it will be fixed in Gtk at some point so that it just works as expected on windows as well

flxzt avatar Jun 09 '24 05:06 flxzt