Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: Allow case-insensitive filters and make that the default #158

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

btzy
Copy link
Owner

@btzy btzy commented Feb 24, 2025

On Linux (both GTK and Portal), file filters are case-sensitive. While Linux uses a case-sensitive filesystem by default and file filters may have been intentionally made case-sensitive, most users expect file filters to be case-insensitive. This was reported to be an issue for GTK3 (https://gitlab.gnome.org/GNOME/gtk/-/issues/3705), and in GTK4 a new API was added for explicitly case-insensitive filtering. Native File Dialog Extended uses GTK3 so we cannot use the new API, but the linked issue notes that we can do case-insensitive filtering in GTK3 by transforming something like "pdf" to "*.[Pp][Dd][Ff]". This is also the recommended way to implement case-insensitive filtering on xdg-desktop-portal (https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.FileChooser.html).

This PR adds a new compile option named NFD_LINUX_CASE_SENSITIVE_FILTER, which is disabled by default (i.e. we get case-insensitive filtering).

While this is in principle a breaking change, I think most users would regard case-sensitive filtering as a bug, and therefore this as a bugfix.

Fixes #157.

@btzy btzy force-pushed the linux-case-insensitive-filter branch 3 times, most recently from fa1233e to 51a82ce Compare March 3, 2025 15:32
@btzy btzy marked this pull request as ready for review March 3, 2025 16:15
@btzy btzy force-pushed the linux-case-insensitive-filter branch from 51a82ce to 15b5e69 Compare March 4, 2025 16:32
@btzy btzy force-pushed the linux-case-insensitive-filter branch from 15b5e69 to 7c4627b Compare March 4, 2025 16:51
@btzy btzy merged commit a1a4010 into master Mar 4, 2025
33 checks passed
@btzy btzy deleted the linux-case-insensitive-filter branch March 4, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GTK file-open case-insensitive filters
1 participant