Skip to content

fix: restore the XDG portal version check for Linux file dialogs - #54227

Merged
MarshallOfSound merged 1 commit into
mainfrom
fix/linux-portal-version-check
Sep 24, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
fix/linux-portal-version-check

Conversation

@MarshallOfSound

@MarshallOfSound MarshallOfSound commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Before: since the Chromium 145 roll (#49175) nothing called StartPortalAvailabilityTestInBackground(), so on Linux IsPortalAvailable() always returned false and logged "Portal availability checked before test was complete" on every open dialog with a defaultPath, and --xdg-portal-required-version had no effect because Chromium hard-codes a minimum portal version of 3.

After: the switch works again and the spurious warning is gone; the defaultPath hint is only logged when the portal in use is older than v4.

  • Drop shell/browser/ui/file_dialog_linux_portal.cc (Electron's private D-Bus probe) and its declarations.
  • Add SelectFileDialogLinuxPortal::SetRequiredPortalVersion() to the existing shell_dialogs patch and feed it from the switch.
  • Use dbus_xdg::RequestXdgDesktopPortal() for the version used in the defaultPath log.

Fixes #49218

Checklist

Release Notes

Notes: Fixed --xdg-portal-required-version having no effect and a spurious portal warning being logged for file dialogs on Linux.

The Chromium 145 roll dropped the patch hunk that called
StartPortalAvailabilityTestInBackground(), so the availability flag was
never set: IsPortalAvailable() always returned false and logged a warning
on every open dialog with a defaultPath, and --xdg-portal-required-version
had no effect because Chromium hard-codes a minimum of 3.

Remove Electron's private D-Bus probe and instead pass the switch value to
SelectFileDialogLinuxPortal through a small setter in the existing dialog
patch, and use dbus_xdg::RequestXdgDesktopPortal() for the defaultPath
hint log.
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner September 23, 2026 07:50
@MarshallOfSound MarshallOfSound added semver/patch backwards-compatible bug fixes target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 23, 2026
@MarshallOfSound MarshallOfSound self-assigned this Sep 23, 2026
@MarshallOfSound
MarshallOfSound merged commit 9bfd737 into main Sep 24, 2026
137 checks passed
@release-clerk

release-clerk Bot commented Sep 24, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed --xdg-portal-required-version having no effect and a spurious portal warning being logged for file dialogs on Linux.

@MarshallOfSound
MarshallOfSound deleted the fix/linux-portal-version-check branch September 24, 2026 17:38
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "45-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot removed the target/45-x-y PR should also be added to the "45-x-y" branch. label Sep 24, 2026
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "44-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/45-x-y needs-manual-bp/43-x-y needs-manual-bp/44-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Sep 24, 2026
@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "45-x-y", please check out #54302

@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "44-x-y", please check out #54303

@trop

trop Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "43-x-y", please check out #54304

MarshallOfSound added a commit that referenced this pull request Sep 24, 2026
…x-y) (#54304)

fix: restore the XDG portal version check for Linux file dialogs (#54227)

The Chromium 145 roll dropped the patch hunk that called
StartPortalAvailabilityTestInBackground(), so the availability flag was
never set: IsPortalAvailable() always returned false and logged a warning
on every open dialog with a defaultPath, and --xdg-portal-required-version
had no effect because Chromium hard-codes a minimum of 3.

Remove Electron's private D-Bus probe and instead pass the switch value to
SelectFileDialogLinuxPortal through a small setter in the existing dialog
patch, and use dbus_xdg::RequestXdgDesktopPortal() for the defaultPath
hint log.

(cherry picked from commit 9bfd737)
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/43-x-y labels Sep 24, 2026
MarshallOfSound added a commit that referenced this pull request Sep 24, 2026
…x-y) (#54303)

fix: restore the XDG portal version check for Linux file dialogs (#54227)

The Chromium 145 roll dropped the patch hunk that called
StartPortalAvailabilityTestInBackground(), so the availability flag was
never set: IsPortalAvailable() always returned false and logged a warning
on every open dialog with a defaultPath, and --xdg-portal-required-version
had no effect because Chromium hard-codes a minimum of 3.

Remove Electron's private D-Bus probe and instead pass the switch value to
SelectFileDialogLinuxPortal through a small setter in the existing dialog
patch, and use dbus_xdg::RequestXdgDesktopPortal() for the defaultPath
hint log.

(cherry picked from commit 9bfd737)
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. and removed in-flight/44-x-y labels Sep 24, 2026
MarshallOfSound added a commit that referenced this pull request Sep 24, 2026
…x-y) (#54302)

fix: restore the XDG portal version check for Linux file dialogs (#54227)

The Chromium 145 roll dropped the patch hunk that called
StartPortalAvailabilityTestInBackground(), so the availability flag was
never set: IsPortalAvailable() always returned false and logged a warning
on every open dialog with a defaultPath, and --xdg-portal-required-version
had no effect because Chromium hard-codes a minimum of 3.

Remove Electron's private D-Bus probe and instead pass the switch value to
SelectFileDialogLinuxPortal through a small setter in the existing dialog
patch, and use dbus_xdg::RequestXdgDesktopPortal() for the defaultPath
hint log.

(cherry picked from commit 9bfd737)
@trop trop Bot added merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Cleanup portal version detection and plumb xdg-portal-required-version flag into upstream

2 participants