diff options
Diffstat (limited to 'src/platformsupport')
4 files changed, 18 insertions, 4 deletions
diff --git a/src/platformsupport/eglconvenience/qeglconvenience.cpp b/src/platformsupport/eglconvenience/qeglconvenience.cpp index 020d035bf7..5ee4773b70 100644 --- a/src/platformsupport/eglconvenience/qeglconvenience.cpp +++ b/src/platformsupport/eglconvenience/qeglconvenience.cpp @@ -268,7 +268,7 @@ EGLConfig QEglConfigChooser::chooseConfig() configureAttributes.append(EGL_OPENGL_ES_BIT); break; } - // fall through + Q_FALLTHROUGH(); default: needsES2Plus = true; break; diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp index c0e528f922..94def16748 100644 --- a/src/platformsupport/eglconvenience/qeglplatformcontext.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformcontext.cpp @@ -134,7 +134,7 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform void QEGLPlatformContext::init(const QSurfaceFormat &format, QPlatformOpenGLContext *share) { - m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig); + m_format = q_glFormatFromConfig(m_eglDisplay, m_eglConfig, format); // m_format now has the renderableType() resolved (it cannot be Default anymore) // but does not yet contain version, profile, options. m_shareContext = share ? static_cast<QEGLPlatformContext *>(share)->m_eglContext : 0; @@ -248,6 +248,12 @@ void QEGLPlatformContext::adopt(const QVariant &nativeHandle, QPlatformOpenGLCon value = 0; eglQueryContext(m_eglDisplay, context, EGL_CONTEXT_CLIENT_TYPE, &value); if (value == EGL_OPENGL_API || value == EGL_OPENGL_ES_API) { + // if EGL config supports both OpenGL and OpenGL ES render type, + // q_glFormatFromConfig() with the default "referenceFormat" parameter + // will always figure it out as OpenGL render type. + // We can override it to match user's real render type. + if (value == EGL_OPENGL_ES_API) + m_format.setRenderableType(QSurfaceFormat::OpenGLES); m_api = value; eglBindAPI(m_api); } else { diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp index 84a468f60c..7609416fea 100644 --- a/src/platformsupport/input/tslib/qtslib.cpp +++ b/src/platformsupport/input/tslib/qtslib.cpp @@ -114,8 +114,8 @@ void QTsLibMouseHandler::readMouseData() int x = sample.x; int y = sample.y; - // work around missing coordinates on mouse release - if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) { + // coordinates on release events can contain arbitrary values, just ignore them + if (sample.pressure == 0) { x = m_x; y = m_y; } diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index ef81f6162d..5f134f5867 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp +++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp @@ -59,6 +59,7 @@ enum OutputConfiguration { OutputConfigOff, OutputConfigPreferred, OutputConfigCurrent, + OutputConfigSkip, OutputConfigMode, OutputConfigModeline }; @@ -191,6 +192,8 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, configuration = OutputConfigPreferred; } else if (mode == "current") { configuration = OutputConfigCurrent; + } else if (mode == "skip") { + configuration = OutputConfigSkip; } else if (sscanf(mode.constData(), "%dx%d@%d", &configurationSize.rwidth(), &configurationSize.rheight(), &configurationRefresh) == 3) { @@ -229,6 +232,11 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, return nullptr; } + if (configuration == OutputConfigSkip) { + qCDebug(qLcKmsDebug) << "Skipping output" << connectorName; + return nullptr; + } + // Get the current mode on the current crtc drmModeModeInfo crtc_mode; memset(&crtc_mode, 0, sizeof crtc_mode); |