fix: xdg portal version detection for file dialogs on linux (#46922)

* chore: use dbus thread for portal version detection

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Update shell/browser/ui/file_dialog_linux_portal.cc

Co-authored-by: Robo <hop2deep@gmail.com>

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2025-05-05 20:59:34 +09:00 committed by GitHub
commit 01994637e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 172 additions and 86 deletions

View file

@ -77,6 +77,16 @@ bool ShowSaveDialogSync(const DialogSettings& settings, base::FilePath* path);
void ShowSaveDialog(const DialogSettings& settings,
gin_helper::Promise<gin_helper::Dictionary> promise);
#if BUILDFLAG(IS_LINUX)
// Rewrite of SelectFileDialogLinuxPortal equivalent functions with primary
// difference being that dbus_thread_linux::GetSharedSessionBus is not used
// so that version detection can be initiated and compeleted on the dbus thread
// Refs https://github.com/electron/electron/issues/46652
void StartPortalAvailabilityTestInBackground();
bool IsPortalAvailable();
uint32_t GetPortalVersion();
#endif
} // namespace file_dialog
#endif // ELECTRON_SHELL_BROWSER_UI_FILE_DIALOG_H_