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

print: Add "supported_output_file_formats" option #1322

Merged

Conversation

GeorgesStavracas
Copy link
Member

This allows applications tell portal backends which file formats they
support. In turn, portal backends can then limit the choices presented
to the user.

@GeorgesStavracas GeorgesStavracas added this to the 1.20 milestone Apr 3, 2024
@GeorgesStavracas GeorgesStavracas self-assigned this Apr 3, 2024
@GeorgesStavracas GeorgesStavracas force-pushed the gbsneto/printing-savage branch 2 times, most recently from 7f68103 to 1e472cd Compare April 3, 2024 16:26
Copy link
Member

@TingPing TingPing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems very reasonable to me.

@matthiasclasen
Copy link
Contributor

I assume this will need a corresponding gtk change to say that we only do pdf ?

@matthiasclasen
Copy link
Contributor

Looks fine to me too

@GeorgesStavracas
Copy link
Member Author

I assume this will need a corresponding gtk change to say that we only do pdf ?

No. I actually thought so, and started looking at GtkPrintOperation - but realized soon enough that, actually, GtkPrintOperation is good and respect the output file format, it uses cairo-pdf for PDF, cairo-ps for PostScript, and plain cairo for SVG.

@GeorgesStavracas GeorgesStavracas added the new api This requires adding API to an existing portal label Apr 9, 2024
This allows applications tell portal backends which file formats they
support. In turn, portal backends can then limit the choices presented
to the user.
@GeorgesStavracas GeorgesStavracas force-pushed the gbsneto/printing-savage branch from 1e472cd to 9b05b7b Compare April 9, 2024 18:43
@grulja
Copy link
Contributor

grulja commented Apr 11, 2024

I think this is fine from Qt POV, my understanding is that it can only print to PDF.

@GeorgesStavracas GeorgesStavracas added this pull request to the merge queue Apr 11, 2024
Merged via the queue into flatpak:main with commit ad2c73c Apr 11, 2024
4 checks passed
@GeorgesStavracas GeorgesStavracas deleted the gbsneto/printing-savage branch April 11, 2024 14:05
webkit-commit-queue pushed a commit to GeorgesStavracas/WebKit that referenced this pull request Apr 22, 2024
https://bugs.webkit.org/show_bug.cgi?id=272913

Reviewed by Michael Catanzaro and Carlos Garcia Campos.

Skia only supports printing to PDF files, but the Print portal assumes
that apps can print to PDF, PS, and SVG formats. If the user selects
PS or SVG through the Print portal dialog, and WebKit is using Skia,
we hit an assertion failure.

The next release of XDG Desktop Portal has new API [1] in the Print
portal made specifically to aid this, we can use it for Skia builds
and if the portal version matches.

[1] flatpak/xdg-desktop-portal#1322

* Source/WebKit/UIProcess/API/gtk/WebKitPrintOperation.cpp:
(webkitPrintOperationPreparePrint):

Canonical link: https://commits.webkit.org/277806@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new api This requires adding API to an existing portal portal: print Printing portal
Projects
No open projects
Status: Triaged
Development

Successfully merging this pull request may close these issues.

4 participants