Bug 492681

Summary: xdg-desktop-portal-kde breaks printing with Inkscape
Product: [Plasma] xdg-desktop-portal-kde Reporter: Tobias Leupold <tl>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: NEEDSINFO WAITINGFORINFO    
Severity: normal CC: aleixpol, jgrulich, kde, kdedev, nate, nicolas.fella, tl
Priority: NOR    
Version: 6.1.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tobias Leupold 2024-09-05 14:48:07 UTC
Hi all,

when printing somehting with Inkscape and xdg-desktop-portal-kde is active, the printed output is way too small. This seems to be a regression, as everything worked okay using the Plasma 5 version.

Having exported GTK_USE_PORTAL=1 via ~/.config/plasma-workspace/env/exports.sh, when I try to print a 10x10cm square, the printed output is 48x48mm. When I do the same without the export, the printed output is the size it should be.

I see this both on my Gentoo desktop and my Artix notebook, both running Plasma 6.1.4, using Inkscape 1.3.2 – so I don't think this is a distribution-specific issue.

I'll gladly help to track this down! Thank for fixing this, so I can get native Firefox file dialogs back ;-)

Cheers, Tobias
Comment 1 Nate Graham 2024-09-16 19:26:23 UTC
Interesting, that is very strange.
Comment 2 TraceyC 2024-09-16 19:45:28 UTC
I can confirm this behavior on Plasma-dev, both Wayland and X11 sessions

Steps to reproduce:
- Installed Discord via repo package
- Installed DiscordCanary via flathub-beta

1. Launched Discord, checked icon in Icons-Only-Task-Manager
Icon is correct - the blue Discord icon
2. Pinned the Discord icon
3. Launched Discord Canary
Initially it showed a separate, yellow icon as expected.
The blue icon was highlighted, I clicked on it. This brought up the Discord Canary window. The yellow icon disappeared. Both windows were grouped under the blue icon now.
4. Closed both versions of Discord and started up Canary
During launch, the yellow icon was shown in the task bar. After it completed loading, the icon changed to the blue icon.


**Notes**
I can also reproduce this behavior with Firefox, on 6.1.5, using two different profiles with different .desktop files. This issue has persisted since 6.0 at least.

I have a pinned icon on the taskbar per profile.
Personal - regular Firefox icon
Work - all white Firefox icon

After launching Firefox with the Personal profile, it correctly shows the windows when interacting with its icon in the taskbar
After launching a new Firefox window with the Work profile:
- The icon for the Work profile is still correctly pinned to the task manager
- All windows from both profiles are grouped under the icon for the Personal profile
Comment 3 TraceyC 2024-09-16 20:33:40 UTC
Apologies, my last reply was for a different bug.

For this bug:
I am unable to reproduce this behavior on Plasma-dev (Wayland)
Inkscape 1.3.2

Steps to reproduce

1. Execute `export GTK_USE_PORTAL=1`
2. Launch Inkscape
3. Create a 10x10cm square and print
4. Execute `export GTK_USE_PORTAL=0`
5. Print the file again

The printout was the same for either. The printed square was 9.5cm square

I noticed that a 10x10mm square printed at about 48mm

Are there more specific steps you're following to enable xdg-desktop-portal-kde maybe?
Comment 4 Tobias Leupold 2024-09-17 07:21:37 UTC
I already wondered ;-)

I set the variables in .config/plasma-workspace/env/exports.sh, containing "export GTK_USE_PORTAL=1".

But it also works if started from the console, i.e running "GTK_USE_PORTAL=1 inkscape" vs. "inkscape". Notice the changed print dialog!

I can reliably reproduce this using Inkscape 1.3.2, xdg-desktop-portal 1.18.4 and xdg-desktop-portal-kde 6.1.4, running Plasma on X11.
Comment 5 TraceyC 2024-09-18 20:27:36 UTC
> But it also works if started from the console, i.e running "GTK_USE_PORTAL=1 inkscape" vs. "inkscape". Notice the changed print dialog!

Thanks for the additional information. I do notice the difference in the print dialog between the two commands, even on Wayland
I had tested previously  with Wayland. I tested again with X11.  I am still unable to reproduce either with git-master or Plasma 6.1.5

Running `GTK_USE_PORTAL=1 inkscape` and bringing up the print dialog with Ctrl P, printing
Inkscape 1.3.2, xdg-desktop-portal 1.18.4, xdg-desktop-portal-kde 6.1.5

Just to check these as possible variables:
- Is your file an .svg? (I was testing with an .svg file)
- What is your printer model? (I have an HP M479fdn color laserjet)