diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-07 17:11:34 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2018-06-07 17:11:34 +0200 |
commit | 45b4c8cb23aa0ca90980c09f183b4815109ff514 (patch) | |
tree | 6b5dced64ed28e2213c2cd2e9426ac5b1fdd7f62 /src/client | |
parent | 75c996e7430a2609a83539d1ef199bd52e722d04 (diff) | |
parent | 590d2e313c5a10dc9c7d61a654ada451e5df82aa (diff) | |
download | qtwayland-45b4c8cb23aa0ca90980c09f183b4815109ff514.tar.gz |
Merge 5.11 into 5.11.1
Change-Id: I3d3cc001320febd64529f0997b88efd69303fa30
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index fdfd6668..5d658f67 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -287,7 +287,18 @@ void QWaylandWindow::setWindowTitle(const QString &title) { if (mShellSurface) { const QString separator = QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH - mShellSurface->setTitle(formatWindowTitle(title, separator)); + const QString formatted = formatWindowTitle(title, separator); + + const int libwaylandMaxBufferSize = 4096; + // Some parts of the buffer is used for metadata, so subtract 100 to be on the safe side + const int maxLength = libwaylandMaxBufferSize - 100; + + auto truncated = QStringRef(&formatted).left(maxLength); + if (truncated.length() < formatted.length()) { + qCWarning(lcQpaWayland) << "Window titles longer than" << maxLength << "characters are not supported." + << "Truncating window title (from" << formatted.length() << "chars)"; + } + mShellSurface->setTitle(truncated.toString()); } if (mWindowDecoration && window()->isVisible()) |