Repository navigation
fix: percent-encode paths passed to org.freedesktop.FileManager1 - #54350
Merged
Merged
Conversation
MarshallOfSound
force-pushed
the
fix/linux-show-item-in-folder-uri
branch
from
September 25, 2026 10:12
1c97ec0 to
a45e144
Compare
shell.showItemInFolder() built the FileManager1 ShowItems URI as "file://" + path, so a path containing '#', '?' or '%' selected the wrong item or nothing. Percent-encode the raw path bytes with base::EscapePath() (net::FilePathToFileURL() would decode the path through the C library locale first and drop non-ASCII paths under a C/POSIX locale). Also keep every in-flight portal OpenDirectory request instead of only the latest one, and don't fall back to opening the parent folder when the portal request was cancelled by the user.
MarshallOfSound
force-pushed
the
fix/linux-show-item-in-folder-uri
branch
from
September 25, 2026 10:30
a45e144 to
1de2c11
Compare
deepak1556
approved these changes
Sep 25, 2026
|
Release Notes Persisted
|
Contributor
|
I was unable to backport this PR to "44-x-y" cleanly; |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54386 |
Contributor
|
@MarshallOfSound has manually backported this PR to "44-x-y", please check out #54406 |
MarshallOfSound
added a commit
that referenced
this pull request
Sep 25, 2026
…x-y) (#54406) fix: percent-encode paths passed to org.freedesktop.FileManager1 (#54350) shell.showItemInFolder() built the FileManager1 ShowItems URI as "file://" + path, so a path containing '#', '?' or '%' selected the wrong item or nothing. Percent-encode the raw path bytes with base::EscapePath() (net::FilePathToFileURL() would decode the path through the C library locale first and drop non-ASCII paths under a C/POSIX locale). Also keep every in-flight portal OpenDirectory request instead of only the latest one, and don't fall back to opening the parent folder when the portal request was cancelled by the user. (cherry picked from commit 7b0b906)
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
On Linux desktops without the OpenURI portal,
shell.showItemInFolder()callsorg.freedesktop.FileManager1.ShowItemswith"file://" + path, so a path containing#,?or%selects the wrong item or nothing. Percent-encode the raw path bytes withbase::EscapePath(). (net::FilePathToFileURL(), which upstream'splatform_util_linux.ccuses, first decodes the path through the C library locale and returns an empty path for non-ASCII names under a C/POSIX locale, so it is not used here.)Also keep every in-flight portal
OpenDirectoryrequest instead of only the most recent one, and don't fall back to opening the parent folder when the portal request was cancelled by the user (both matching upstream).Checklist
Release Notes
Notes: Fixed
shell.showItemInFolder()on Linux for paths containing#,?or%when the file manager is reached over D-Bus.