From ca19cba2ac3cf9785b9a2211c4ba7d1e14d87bf2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 14 Dec 2012 18:25:03 +0100 Subject: Factorize code for formatting window titles into QPlatformWindow. Change-Id: I0dcccd08916fc2ea1b795681e9b98a9550ef51b6 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/xcb/qxcbwindow.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 60cc547979..b7668e6270 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1122,18 +1122,8 @@ void QXcbWindow::setParent(const QPlatformWindow *parent) void QXcbWindow::setWindowTitle(const QString &title) { - QString fullTitle = title; - if (QGuiApplicationPrivate::displayName) { - // Append display name, if set. - if (!fullTitle.isEmpty()) - fullTitle += QString::fromUtf8(" \xe2\x80\x94 "); // unicode character U+2014, EM DASH - fullTitle += *QGuiApplicationPrivate::displayName; - } else if (fullTitle.isEmpty()) { - // Don't let the window title be completely empty, use the app name as fallback. - fullTitle = QCoreApplication::applicationName(); - } + const QString fullTitle = formatWindowTitle(title, QString::fromUtf8(" \xe2\x80\x94 ")); // unicode character U+2014, EM DASH const QByteArray ba = fullTitle.toUtf8(); - Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, -- cgit v1.2.3 From 82eaff97d1e7227e7a566b8576ca76f9dd447c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Mon, 4 Feb 2013 15:51:35 +0100 Subject: Don't ignore QSurfaceFormat::Options in the XCB plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The XCB plugin requested a forward-compatible context regardless of whether QSurfaceFormat::DeprecatedFunctions was set, and also ignored the QSurfaceFormat::DebugContext option. Change-Id: I81c737447b554b3b6f61c2725bce7583e0e887ab Reviewed-by: Sean Harmer Reviewed-by: Giuseppe D'Angelo Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qglxintegration.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 80fcbbebc6..23bec15b48 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -305,14 +305,24 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat // If asking for OpenGL 3.2 or newer we should also specify a profile if (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1)) { - if (m_format.profile() == QSurfaceFormat::CoreProfile) { - contextAttributes << GLX_CONTEXT_FLAGS_ARB << GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB - << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB; - } else { + if (m_format.profile() == QSurfaceFormat::CoreProfile) + contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + else contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; - } } + int flags = 0; + + if (m_format.testOption(QSurfaceFormat::DebugContext)) + flags |= GLX_CONTEXT_DEBUG_BIT_ARB; + + // A forward-compatible context may be requested for 3.0 and later + if (m_format.majorVersion() >= 3 && !m_format.testOption(QSurfaceFormat::DeprecatedFunctions)) + flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; + + if (flags != 0) + contextAttributes << GLX_CONTEXT_FLAGS_ARB << flags; + contextAttributes << None; m_context = glXCreateContextAttribsARB(DISPLAY_FROM_XCB(screen), config, m_shareContext, true, contextAttributes.data()); -- cgit v1.2.3