Modernizing the GTK Print Dialog with Integrated Preview – Feedback Welcome

I’m working on enhancing the GTK Print Dialog by creating a modern interface with a built-in preview in the main view. This project aims to solve critical usability issues present in current GTK applications like Evince, Gedit, GIMP, and Inkscape.

Key Problems Identified

  • Disjointed Workflow: Currently, when users click “Preview” in the print dialog, it closes and opens a separate preview pane with no way to return to settings without starting over
  • Lack of Synchronization: Changes made in print settings aren’t reflected in the preview
  • Inconsistent Experience: These issues persist across all GTK applications

Implementation Plan
My approach involves a phased implementation:

  • Phase 1: Add a “Return” button to the print preview pane
  • Phase 2: Synchronize print settings with the preview pane
  • Phase 3: Create an extendable print preview system that applications can customize
  • Phase 4: Develop a unified dialog that combines both print settings and preview

Technical Approach
After researching solutions from Chromium, Firefox, and LibreOffice, I’ve determined that:

  • LibreOffice’s approach is most suitable for GTK as a system software
  • We need a shared widget to combine preview and dialog for consistency
  • GTK’s signal system will be used for synchronization between components
  • The preview system should be extendable to accommodate different document types
1 Like

Hi @Yash_kumar_kasaudhan !

This would also affect the print dialog which is created for the print portal, right?

Recently we had people complain at GIMP because when GIMP calls the print feature within a flatpak, it runs the print portal instead of our custom print dialog. The problem is that our custom print dialog is indeed the generic GTK print dialog + some additional “Image Settings” tab where you can actually further tweak the printing (and that works very well): Draft: GIMP_PRINT_UNSTABLE_ANTI_PORTAL_WORKAROUND (!2021) · Merge requests · GNOME / GIMP · GitLab

Of course, we cannot edit the print widget in the portal as we have no control on this process. So we lost this feature when running in flatpak.

And as it turns out, it is true that without this tab, the print is hardly usable. I tried too after getting this report and that was not going great. It’s so much less usable (to say it nicely) that we had someone contributing a patch hijacking a GLib function to bypass the portal (it’s the MR in the link above!), which — despite being an interesting hack — felt not too long-term proof.

Anyway bottom line, it would be very nice if the default print dialog, hence the GTK/GNOME print portal too, had more such usable features. Right now, trying to print with GIMP in its flatpak version is simply not usable (I really tried). So if you rework this print dialog, that would also be something I’d suggest to work on.

This way, no software (neither GIMP nor eog nor others) would have to customize the print dialog and we could just use the default vanilla print dialog (which would be the same as the portal version, I assume; no feature loss!).

1 Like