diff options
author | Liang Qi <liang.qi@qt.io> | 2018-10-25 07:21:05 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-25 07:21:53 +0200 |
commit | e28e91ae99b8c3859899e04cc9370534c7c7b86d (patch) | |
tree | cca81b1e745be4f25aab78e8e917c2324594e539 /src/platformsupport | |
parent | 5ea233ca6782eb27adf596515cb66ef3dadc1d5e (diff) | |
parent | ebfad73b4e44fe6db8059200da105b4b87888718 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/animation/qpropertyanimation.cpp
src/gui/image/qicon.cpp
tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
Diffstat (limited to 'src/platformsupport')
6 files changed, 48 insertions, 13 deletions
diff --git a/src/platformsupport/edid/qedidparser.cpp b/src/platformsupport/edid/qedidparser.cpp index ccaa50704c..06c8852825 100644 --- a/src/platformsupport/edid/qedidparser.cpp +++ b/src/platformsupport/edid/qedidparser.cpp @@ -166,7 +166,7 @@ QString QEdidParser::parseEdidString(const quint8 *data) // Replace non-printable characters with dash for (int i = 0; i < buffer.count(); ++i) { - if (buffer[i] < '\040' && buffer[i] > '\176') + if (buffer[i] < '\040' || buffer[i] > '\176') buffer[i] = '-'; } diff --git a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp index 565dbfb11b..ac743e1e38 100644 --- a/src/platformsupport/eglconvenience/qxlibeglintegration.cpp +++ b/src/platformsupport/eglconvenience/qxlibeglintegration.cpp @@ -91,21 +91,21 @@ VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay int visualRedSize = qPopulationCount(chosenVisualInfo->red_mask); int visualGreenSize = qPopulationCount(chosenVisualInfo->green_mask); int visualBlueSize = qPopulationCount(chosenVisualInfo->blue_mask); - int visualAlphaSize = chosenVisualInfo->depth == 32 ? 8 : 0; + int visualAlphaSize = chosenVisualInfo->depth - visualRedSize - visualBlueSize - visualGreenSize; - const bool visualMatchesConfig = visualRedSize == configRedSize - && visualGreenSize == configGreenSize - && visualBlueSize == configBlueSize - && visualAlphaSize == configAlphaSize; + const bool visualMatchesConfig = visualRedSize >= configRedSize + && visualGreenSize >= configGreenSize + && visualBlueSize >= configBlueSize + && visualAlphaSize >= configAlphaSize; // In some cases EGL tends to suggest a 24-bit visual for 8888 // configs. In such a case we have to fall back to XGetVisualInfo. if (!visualMatchesConfig) { visualId = 0; qCDebug(lcXlibEglDebug, - "EGL suggested using X Visual ID %d (%d %d %d depth %d) for EGL config %d" + "EGL suggested using X Visual ID %d (%d %d %d %d depth %d) for EGL config %d" "(%d %d %d %d), but this is incompatible", - (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, chosenVisualInfo->depth, + (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, visualAlphaSize, chosenVisualInfo->depth, configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize); } } else { diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp index dc4785071f..0ccbf01e80 100644 --- a/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp +++ b/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp @@ -52,17 +52,14 @@ struct GUserEventSource { GSource source; QPAEventDispatcherGlib *q; + QPAEventDispatcherGlibPrivate *d; }; static gboolean userEventSourcePrepare(GSource *source, gint *timeout) { Q_UNUSED(timeout) GUserEventSource *userEventSource = reinterpret_cast<GUserEventSource *>(source); - QPAEventDispatcherGlib *dispatcher = userEventSource->q; - if (dispatcher->m_flags & QEventLoop::ExcludeUserInputEvents) - return QWindowSystemInterface::nonUserInputEventsQueued(); - else - return QWindowSystemInterface::windowSystemEventsQueued() > 0; + return userEventSource->d->wakeUpCalled; } static gboolean userEventSourceCheck(GSource *source) @@ -94,6 +91,7 @@ QPAEventDispatcherGlibPrivate::QPAEventDispatcherGlibPrivate(GMainContext *conte userEventSource = reinterpret_cast<GUserEventSource *>(g_source_new(&userEventSourceFuncs, sizeof(GUserEventSource))); userEventSource->q = q; + userEventSource->d = this; g_source_set_can_recurse(&userEventSource->source, true); g_source_attach(&userEventSource->source, mainContext); } diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index 8d2e58b57b..d7cc36627a 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -42,13 +42,18 @@ #include <QtCore/QByteArray> #include <QtCore/QScopedPointer> +#include <QtCore/qmetatype.h> +#include <QtCore/qtextstream.h> #include "qglxconvenience_p.h" +#include <QtCore/QLoggingCategory> #include <QtCore/QVector> #include <QtCore/QVarLengthArray> #include <GL/glxext.h> +Q_LOGGING_CATEGORY(lcGlx, "qt.glx") + enum { XFocusOut = FocusOut, XFocusIn = FocusIn, @@ -207,6 +212,7 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format const int requestedBlue = qMax(0, format.blueBufferSize()); const int requestedAlpha = qMax(0, format.alphaBufferSize()); + GLXFBConfig compatibleCandidate = nullptr; for (int i = 0; i < confcount; i++) { GLXFBConfig candidate = configs[i]; @@ -226,6 +232,16 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format const int actualBlue = qPopulationCount(visual->blue_mask); const int actualAlpha = visual->depth - actualRed - actualGreen - actualBlue; + if (requestedRed && actualRed < requestedRed) + continue; + if (requestedGreen && actualGreen < requestedGreen) + continue; + if (requestedBlue && actualBlue < requestedBlue) + continue; + if (requestedAlpha && actualAlpha < requestedAlpha) + continue; + compatibleCandidate = candidate; + if (requestedRed && actualRed != requestedRed) continue; if (requestedGreen && actualGreen != requestedGreen) @@ -237,6 +253,11 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format return candidate; } + if (compatibleCandidate) { + qCDebug(lcGlx) << "qglx_findConfig: Found non-matching but compatible FBConfig"; + return compatibleCandidate; + } + qCWarning(lcGlx, "qglx_findConfig: Failed to finding matching FBConfig (%d %d %d %d)", requestedRed, requestedGreen, requestedBlue, requestedAlpha); } while (qglx_reduceFormat(&format)); return config; @@ -352,6 +373,18 @@ void qglx_surfaceFormatFromVisualInfo(QSurfaceFormat *format, Display *display, bool qglx_reduceFormat(QSurfaceFormat *format) { Q_ASSERT(format); + if (std::max(std::max(format->redBufferSize(), format->greenBufferSize()), format->blueBufferSize()) > 8) { + if (format->alphaBufferSize() > 2) { + // First try to match 10 10 10 2 + format->setAlphaBufferSize(2); + return true; + } + + format->setRedBufferSize(std::min(format->redBufferSize(), 8)); + format->setGreenBufferSize(std::min(format->greenBufferSize(), 8)); + format->setBlueBufferSize(std::min(format->blueBufferSize(), 8)); + return true; + } if (format->redBufferSize() > 1) { format->setRedBufferSize(1); diff --git a/src/platformsupport/linuxaccessibility/constant_mappings.cpp b/src/platformsupport/linuxaccessibility/constant_mappings.cpp index de4a68dc5b..ef2b3429d2 100644 --- a/src/platformsupport/linuxaccessibility/constant_mappings.cpp +++ b/src/platformsupport/linuxaccessibility/constant_mappings.cpp @@ -83,6 +83,8 @@ quint64 spiStatesFromQState(QAccessible::State state) // if (state.HotTracked) if (state.defaultButton) setSpiStateBit(&spiState, ATSPI_STATE_IS_DEFAULT); + if (state.expandable) + setSpiStateBit(&spiState, ATSPI_STATE_EXPANDABLE); if (state.expanded) setSpiStateBit(&spiState, ATSPI_STATE_EXPANDED); if (state.collapsed) diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp index 63a860f251..43d49cbbc8 100644 --- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp +++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp @@ -49,7 +49,9 @@ #include <QtCore/QFile> #include <QtCore/QDebug> #include <QtCore/QHash> +#if QT_CONFIG(mimetype) #include <QtCore/QMimeDatabase> +#endif #include <QtCore/QLoggingCategory> #include <QtCore/QSettings> #include <QtCore/QVariant> |