Merge 5.11 into 5.11.1
Change-Id: I3d3cc001320febd64529f0997b88efd69303fa30
This commit is contained in:
commit
d92ccb70a5
@ -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())
|
||||
|
@ -181,6 +181,7 @@ private slots:
|
||||
void hiddenTransientParent();
|
||||
void hiddenPopupParent();
|
||||
void glWindow();
|
||||
void longWindowTitle();
|
||||
|
||||
private:
|
||||
MockCompositor *compositor = nullptr;
|
||||
@ -582,6 +583,16 @@ void tst_WaylandClient::glWindow()
|
||||
QTRY_VERIFY(!compositor->surface());
|
||||
}
|
||||
|
||||
void tst_WaylandClient::longWindowTitle()
|
||||
{
|
||||
// See QTBUG-68715
|
||||
QWindow window;
|
||||
QString absurdlyLongTitle(10000, QLatin1Char('z'));
|
||||
window.setTitle(absurdlyLongTitle);
|
||||
window.show();
|
||||
QTRY_VERIFY(compositor->surface());
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
setenv("XDG_RUNTIME_DIR", ".", 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user