Bug 466056

Summary: " - Portal" shown in titlebar.
Product: [Plasma] xdg-desktop-portal-kde Reporter: Craig Drummond <craig>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: aleixpol, jgrulich, nate, nicolas.fella
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Craig Drummond 2023-02-19 08:07:25 UTC
SUMMARY
When opening a file with Firefox, opening with Chromium, saving with Firefox, or adding an attachment with Thunderbird, the KDE file picker has " - Portal" shown in its titlebar (as well as a Generic KDE icon).

I realise its probably the requesting app's  fault that no title is passed to the portal, however " - Portal" is meaningless to most users. Would it not be better to just have no application name (and no icon) in the file picker dialog here? For example the LibreOffice file picker simply has "Open" and not "Open - LibreOffice"


STEPS TO REPRODUCE
1. Start Firefox
2. Select "Save page as..." from menu

OBSERVED RESULT
KDE file picker is shown with "Save As - Portal"

EXPECTED RESULT
KDE file picker with "Save As - Firefox", but "Save As" would be acceptable.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 22.10
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.6
Kernel Version: 5.19.0-31-generic (64-bit)

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-02-21 18:39:41 UTC
Yeah we should override the title to omit the app name (technically that's what it is; the portal dialog is actually a separate app, not a dialog spawned by the other window itself).
Comment 2 Nicolas Fella 2023-02-24 12:40:18 UTC
From a technical POV this is a bit tricky, the "application" name is set by Qt internally. See https://bugreports.qt.io/browse/QTBUG-111497
Comment 3 Nate Graham 2023-02-28 18:23:21 UTC
Per the resolution to that bug report, Qt devs say we can do this ourselves by clearing the display name.
Comment 4 Bug Janitor Service 2023-03-12 13:38:58 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/180
Comment 5 Nicolas Fella 2023-03-21 12:00:59 UTC
Git commit dff2ad19d38241d2fa9997311c5801a0617ddb86 by Nicolas Fella.
Committed on 21/03/2023 at 11:54.
Pushed by nicolasfella into branch 'master'.

Unset QApplication::applicationDisplayName()

Otherwise windows created by the portal get '- Portal' added to their window title, which should be avoided because it's an implementation detail meaningless to the user

M  +1    -1    src/xdg-desktop-portal-kde.cpp

https://invent.kde.org/plasma/xdg-desktop-portal-kde/commit/dff2ad19d38241d2fa9997311c5801a0617ddb86