Skip to content

fix: register PrintDialogLinuxFactory on Linux - #50430

Merged
ckerr merged 1 commit into
mainfrom
fix-print-linux
Mar 25, 2026
Merged

ckerr merged 1 commit into
mainfrom
fix-print-linux

Conversation

@codebytere

@codebytere codebytere commented Mar 23, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Fixes #50420

Chromium 145 refactored Linux print dialog creation to use a factory pattern instead of directly calling LinuxUi::CreatePrintDialog(). Chrome registers this factory in
ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized(), but Electron did not, causing PrintingContextLinux::EnsurePrintDialog() to leave print_dialog_ null on every call.

Without a dialog, UseDefaultSettings() and UpdatePrinterSettings() return success but with empty/unprocessed settings, causing PrintMsgPrintParamsIsValid() to fail. This broke both window.print() and webContents.print().

Checklist

Release Notes

Notes: Fixed printing on Linux failing with "Invalid printer settings".

Chromium 145 refactored Linux print dialog creation to use a factory
pattern instead of directly calling LinuxUi::CreatePrintDialog().
Chrome registers this factory in
ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized(), but
Electron did not, causing PrintingContextLinux::EnsurePrintDialog()
to leave print_dialog_ null on every call.

Without a dialog, UseDefaultSettings() and UpdatePrinterSettings()
return success but with empty/unprocessed settings, causing
PrintMsgPrintParamsIsValid() to fail. This broke both window.print()
(no dialog appears) and webContents.print() (callback stuck until
app close with "Invalid printer settings").
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. labels Mar 23, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Mar 23, 2026
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Mar 24, 2026
@ckerr
ckerr merged commit 7451d56 into main Mar 25, 2026
129 of 130 checks passed
@ckerr
ckerr deleted the fix-print-linux branch March 25, 2026 17:37
@release-clerk

release-clerk Bot commented Mar 25, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed printing on Linux failing with "Invalid printer settings".

@trop

trop Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "40-x-y", please check out #50485

@trop

trop Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "41-x-y", please check out #50486

@trop trop Bot removed the target/40-x-y PR should also be added to the "40-x-y" branch. label Mar 25, 2026
@trop

trop Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #50487

@trop trop Bot added in-flight/41-x-y in-flight/42-x-y merged/42-x-y PR was merged to the "42-x-y" branch. and removed target/41-x-y PR should also be added to the "41-x-y" branch. target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/42-x-y labels Mar 25, 2026
@trop trop Bot added merged/41-x-y PR was merged to the "41-x-y" branch. and removed in-flight/40-x-y in-flight/41-x-y labels Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/41-x-y PR was merged to the "41-x-y" branch. merged/42-x-y PR was merged to the "42-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Print methods fail on Electron 41 under Linux

3 participants