Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev
This commit is contained in:
commit
8a14be4437
@ -135,7 +135,7 @@ QVariant QWaylandMimeData::retrieveData_sys(const QString &mimeType, QVariant::T
|
|||||||
}
|
}
|
||||||
|
|
||||||
int pipefd[2];
|
int pipefd[2];
|
||||||
if (::pipe2(pipefd, O_CLOEXEC|O_NONBLOCK) == -1) {
|
if (qt_safe_pipe(pipefd, O_NONBLOCK) == -1) {
|
||||||
qWarning("QWaylandMimeData: pipe2() failed");
|
qWarning("QWaylandMimeData: pipe2() failed");
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include <QtGui/private/qdnd_p.h>
|
#include <QtGui/private/qinternalmimedata_p.h>
|
||||||
|
|
||||||
#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
|
#include <QtWaylandClient/private/qtwaylandclientglobal_p.h>
|
||||||
#include <QtWaylandClient/private/qwayland-wayland.h>
|
#include <QtWaylandClient/private/qwayland-wayland.h>
|
||||||
|
@ -52,7 +52,12 @@
|
|||||||
#include "qwaylandwindowmanagerintegration_p.h"
|
#include "qwaylandwindowmanagerintegration_p.h"
|
||||||
#include "qwaylandscreen_p.h"
|
#include "qwaylandscreen_p.h"
|
||||||
|
|
||||||
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
|
#if defined(Q_OS_MACOS)
|
||||||
|
# include <QtFontDatabaseSupport/private/qcoretextfontdatabase_p.h>
|
||||||
|
# include <QtFontDatabaseSupport/private/qfontengine_coretext_p.h>
|
||||||
|
#else
|
||||||
|
# include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
|
||||||
|
#endif
|
||||||
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
|
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
|
||||||
#include <QtThemeSupport/private/qgenericunixthemes_p.h>
|
#include <QtThemeSupport/private/qgenericunixthemes_p.h>
|
||||||
|
|
||||||
@ -118,7 +123,11 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QWaylandIntegration::QWaylandIntegration()
|
QWaylandIntegration::QWaylandIntegration()
|
||||||
|
#if defined(Q_OS_MACOS)
|
||||||
|
: mFontDb(new QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>)
|
||||||
|
#else
|
||||||
: mFontDb(new QGenericUnixFontDatabase())
|
: mFontDb(new QGenericUnixFontDatabase())
|
||||||
|
#endif
|
||||||
, mNativeInterface(new QWaylandNativeInterface(this))
|
, mNativeInterface(new QWaylandNativeInterface(this))
|
||||||
#if QT_CONFIG(accessibility)
|
#if QT_CONFIG(accessibility)
|
||||||
, mAccessibility(new QPlatformAccessibility())
|
, mAccessibility(new QPlatformAccessibility())
|
||||||
|
@ -282,7 +282,18 @@ void QWaylandWindow::setWindowTitle(const QString &title)
|
|||||||
{
|
{
|
||||||
if (mShellSurface) {
|
if (mShellSurface) {
|
||||||
const QString separator = QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH
|
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())
|
if (mWindowDecoration && window()->isVisible())
|
||||||
|
@ -162,6 +162,7 @@ public slots:
|
|||||||
// make sure the surfaces from the last test are properly cleaned up
|
// make sure the surfaces from the last test are properly cleaned up
|
||||||
// and don't show up as false positives in the next test
|
// and don't show up as false positives in the next test
|
||||||
QTRY_VERIFY(!compositor->surface());
|
QTRY_VERIFY(!compositor->surface());
|
||||||
|
QTRY_VERIFY(!compositor->iviSurface());
|
||||||
QTRY_VERIFY(!compositor->xdgToplevelV6());
|
QTRY_VERIFY(!compositor->xdgToplevelV6());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +182,7 @@ private slots:
|
|||||||
void hiddenTransientParent();
|
void hiddenTransientParent();
|
||||||
void hiddenPopupParent();
|
void hiddenPopupParent();
|
||||||
void glWindow();
|
void glWindow();
|
||||||
|
void longWindowTitle();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MockCompositor *compositor = nullptr;
|
MockCompositor *compositor = nullptr;
|
||||||
@ -597,6 +599,16 @@ void tst_WaylandClient::glWindow()
|
|||||||
QTRY_VERIFY(!compositor->surface());
|
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)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
setenv("XDG_RUNTIME_DIR", ".", 1);
|
setenv("XDG_RUNTIME_DIR", ".", 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user