Bug 364391

Summary: Cannot remove "- Konsole" suffix from the titlebar
Product: [Applications] konsole Reporter: Jason Tibbitts <j>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal CC: john.b.little, mail, octoploid, rdieter
Priority: NOR Keywords: triaged
Version: 18.08.2   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 19.04

Description Jason Tibbitts 2016-06-16 17:31:55 UTC
Konsole has an option "Show application name on the titlebar", which .  This option appears to do nothing in current version of Konsole.

There's a bug reporting exactly the opposite at https://bugs.kde.org/show_bug.cgi?id=343995, but the first comment echoes this issue and gives some explanation.  I'll paste it in here.

----------------
Kurt Hindenburg 2015-10-16 19:05:01 UTC
In the latest version,  the "Enable Show "- Konsole" on the titlebar in general settings." is ignored now as it appears that KF5/Qt5 always shows the "- Konsole".  I'm not sure if it is possible to remove it now.

http://doc.qt.io/qt-5/qwidget.html#windowTitle-prop

"On some desktop platforms (including Windows and Unix), the application name (from QGuiApplication::applicationDisplayName) is added at the end of the window title, if set. This is done by the QPA plugin, so it is shown to the user, but isn't part of the windowTitle string."
----------------------

Many of us would like for the Konsole title bar to be completely controlled by the shell, and so not being able to get rid of that bit is pretty annoying.  But at least the option in the configuration dialog should go away if it's simply not possible to actually remove that bit from the title bar.

Reproducible: Always

Steps to Reproduce:
1. In konsole, select Settings -> Configure Konsole...
2. Under General, make sure "Show application name on the titlebar" is not selected
3. Click Apply or OK.

Actual Results:  
"-- Konsole" suffix still appears in the window title bar.

Expected Results:  
"-- Konsole" suffiex does not appear in the window title bar, leaving the title to reflect exactly what's specified by the profile's tag title format.
Comment 1 Christoph Feck 2016-06-16 22:19:51 UTC
Here is a translation of the section you quoted: The application name is added by Qt, so you should report it directly to Qt developers.
Comment 2 Jason Tibbitts 2016-06-16 22:22:13 UTC
And that's why I mentioned that the option should be removed from Konsole if it's not possible for Konsole to control this.
Comment 3 Markus Trippelsdorf 2016-11-24 21:12:52 UTC
You can use this hack:

diff --git a/src/main.cpp b/src/main.cpp
index 26d3da990b6a..a99ce6b25a2f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -93,8 +93,8 @@ extern "C" int Q_DECL_EXPORT kdemain(int argc, char* argv[])

     KLocalizedString::setApplicationDomain("konsole");

-    KAboutData about(QStringLiteral("konsole"),
-                     i18nc("@title", "Konsole"),
+    KAboutData about(QStringLiteral(""),
+                     i18nc("@title", ""),
                      QStringLiteral(KONSOLE_VERSION),
                      i18nc("@title", "Terminal emulator"),
                      KAboutLicense::GPL_V2,
Comment 4 Julian Steinmann 2018-10-30 19:05:37 UTC
Can confirm that this behavior does still exist with Konsole 18.08.2 and Qt 5.11.2. We should remove the option for now, and consider reporting the problem to the Qt developers.
Comment 5 Kurt Hindenburg 2018-11-22 15:06:14 UTC
Git commit d1e5296ef4e423182012a49c1e902718330798e1 by Kurt Hindenburg, on behalf of Andrew Smith.
Committed on 22/11/2018 at 15:06.
Pushed by hindenburg into branch 'master'.

Remove option to hide application name from titlebar

Summary:
Since the application name is added by Qt, it is no longer
possible to remove the trailing '- Konsole' so the GUI
option is obsolete.
FIXED-IN: 19.03

Test Plan:
Change settings for existing Konsole and notice that the checkbox
doesn't change anything. After applying this the checkbox should
be removed.

Reviewers: #konsole, konsole-devel, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D17049

M  +1    -5    src/MainWindow.cpp
M  +0    -13   src/settings/GeneralSettings.ui
M  +0    -5    src/settings/konsole.kcfg

https://commits.kde.org/konsole/d1e5296ef4e423182012a49c1e902718330798e1
Comment 6 John Little 2019-02-03 03:01:41 UTC
Just stumbled on this bug report with a recent comment.

A partial, kludgy, work around with X for this Qt "feature" is to use xprop:

xprop -id $WINDOWID -format _NET_WM_NAME 8u -set _NET_WM_NAME "whatever"

For example, with bash,

PROMPT_COMMAND='xprop -id $WINDOWID -format _NET_WM_NAME 8u -set _NET_WM_NAME "$PWD"'