Call formatWindowTitle on the window title

According to QWidget::setWindowTitle documentation the QPA plugin is
responsible for adding the application name to the window title.
As it's supposed to be done for Unix platform the Wayland QPA also needs
to perform this task.

Task-number: QTBUG-56475
Change-Id: Ib261c68d08ca06d1ec4734c8c215a4ceb059fae3
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
This commit is contained in:
Martin Gräßlin 2016-10-11 13:06:51 +02:00
parent 867734461f
commit 039f8acf6a

View File

@ -137,7 +137,7 @@ void QWaylandWindow::initWindow()
if (mShellSurface) {
// Set initial surface title
mShellSurface->setTitle(window()->title());
setWindowTitle(window()->title());
// The appId is the desktop entry identifier that should follow the
// reverse DNS convention (see http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html).
@ -258,7 +258,8 @@ void QWaylandWindow::setParent(const QPlatformWindow *parent)
void QWaylandWindow::setWindowTitle(const QString &title)
{
if (mShellSurface) {
mShellSurface->setTitle(title);
const QString separator = QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH
mShellSurface->setTitle(formatWindowTitle(title, separator));
}
if (mWindowDecoration && window()->isVisible())