diff options
Diffstat (limited to 'src/plugins/platforms')
20 files changed, 142 insertions, 135 deletions
diff --git a/src/plugins/platforms/android/extract.cpp b/src/plugins/platforms/android/extract.cpp index 8620aa4fe8..e6636e37d4 100644 --- a/src/plugins/platforms/android/extract.cpp +++ b/src/plugins/platforms/android/extract.cpp @@ -1,26 +1,37 @@ /**************************************************************************** ** ** Copyright (C) 2014 BogDan Vatra <bogdan@kde.org> -** Contact: http://www.qt.io/licensing/ +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3-COMM$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp index a14271c8f5..2fdf269566 100644 --- a/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp +++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.cpp @@ -66,7 +66,7 @@ void QAndroidPlatformFontDatabase::populateFontDatabase() const auto entries = dir.entryInfoList(nameFilters, QDir::Files); for (const QFileInfo &fi : entries) { const QByteArray file = QFile::encodeName(fi.absoluteFilePath()); - QBasicFontDatabase::addTTFile(QByteArray(), file); + QFreeTypeFontDatabase::addTTFile(QByteArray(), file); } } @@ -82,7 +82,7 @@ QStringList QAndroidPlatformFontDatabase::fallbacksForFamily(const QString &fami result.append(QString(qgetenv("QT_ANDROID_FONTS_SERIF")).split(QLatin1Char(';'))); else result.append(QString(qgetenv("QT_ANDROID_FONTS")).split(QLatin1Char(';'))); - result.append(QBasicFontDatabase::fallbacksForFamily(family, style, styleHint, script)); + result.append(QFreeTypeFontDatabase::fallbacksForFamily(family, style, styleHint, script)); return result; } diff --git a/src/plugins/platforms/android/qandroidplatformfontdatabase.h b/src/plugins/platforms/android/qandroidplatformfontdatabase.h index 533d6e50a9..166a590698 100644 --- a/src/plugins/platforms/android/qandroidplatformfontdatabase.h +++ b/src/plugins/platforms/android/qandroidplatformfontdatabase.h @@ -40,11 +40,11 @@ #ifndef QANDROIDPLATFORMFONTDATABASE_H #define QANDROIDPLATFORMFONTDATABASE_H -#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h> +#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h> QT_BEGIN_NAMESPACE -class QAndroidPlatformFontDatabase: public QBasicFontDatabase +class QAndroidPlatformFontDatabase: public QFreeTypeFontDatabase { public: QString fontDir() const override; diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp index d3810329c5..89ac0cbd93 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.cpp @@ -67,42 +67,11 @@ void QAndroidPlatformOpenGLContext::swapBuffers(QPlatformSurface *surface) QEGLPlatformContext::swapBuffers(surface); } -bool QAndroidPlatformOpenGLContext::needsFBOReadBackWorkaround() -{ - static bool set = false; - static bool needsWorkaround = false; - - if (!set) { - QByteArray env = qgetenv("QT_ANDROID_DISABLE_GLYPH_CACHE_WORKAROUND"); - needsWorkaround = env.isEmpty() || env == "0" || env == "false"; - - if (!needsWorkaround) { - const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER)); - needsWorkaround = - qstrncmp(rendererString, "Mali-4xx", 6) == 0 // Mali-400, Mali-450 - || qstrncmp(rendererString, "Adreno (TM) 2xx", 13) == 0 // Adreno 200, 203, 205 - || qstrncmp(rendererString, "Adreno 2xx", 8) == 0 // Same as above but without the '(TM)' - || qstrncmp(rendererString, "Adreno (TM) 30x", 14) == 0 // Adreno 302, 305 - || qstrncmp(rendererString, "Adreno 30x", 9) == 0 // Same as above but without the '(TM)' - || qstrcmp(rendererString, "GC800 core") == 0 - || qstrcmp(rendererString, "GC1000 core") == 0 - || qstrcmp(rendererString, "Immersion.16") == 0; - } - - set = true; - } - - return needsWorkaround; -} - bool QAndroidPlatformOpenGLContext::makeCurrent(QPlatformSurface *surface) { bool ret = QEGLPlatformContext::makeCurrent(surface); QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context()); - if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) - ctx_d->workaround_brokenFBOReadBack = true; - return ret; } diff --git a/src/plugins/platforms/android/qandroidplatformopenglcontext.h b/src/plugins/platforms/android/qandroidplatformopenglcontext.h index 3897b3166b..8e65b4cc36 100644 --- a/src/plugins/platforms/android/qandroidplatformopenglcontext.h +++ b/src/plugins/platforms/android/qandroidplatformopenglcontext.h @@ -55,7 +55,6 @@ public: private: EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override; - static bool needsFBOReadBackWorkaround(); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index e39d5e4546..4ba3dcb9a6 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -101,7 +101,7 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions; } - (NSString *)strip:(const QString &)label; -- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; +- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url; - (void)filterChanged:(id)sender; - (void)showModelessPanel; - (BOOL)runApplicationModalPanel; @@ -222,12 +222,12 @@ static QString strippedText(QString s) if (mOpenPanel){ QFileInfo info(*mCurrentSelection); NSString *filepath = info.filePath().toNSString(); + NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()]; bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:nil shouldShowFilename:filepath]; + || [self panel:nil shouldEnableURL:url]; [self updateProperties]; QCocoaMenuBar::redirectKnownMenuItemsToFirstResponder(); - [mOpenPanel setAllowedFileTypes:nil]; [mSavePanel setNameFieldStringValue:selectable ? info.fileName().toNSString() : @""]; [mOpenPanel beginWithCompletionHandler:^(NSInteger result){ @@ -242,8 +242,9 @@ static QString strippedText(QString s) { QFileInfo info(*mCurrentSelection); NSString *filepath = info.filePath().toNSString(); + NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()]; bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:nil shouldShowFilename:filepath]; + || [self panel:nil shouldEnableURL:url]; [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]]; [mSavePanel setNameFieldStringValue:selectable ? info.fileName().toNSString() : @""]; @@ -273,8 +274,9 @@ static QString strippedText(QString s) { QFileInfo info(*mCurrentSelection); NSString *filepath = info.filePath().toNSString(); + NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()]; bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:nil shouldShowFilename:filepath]; + || [self panel:nil shouldEnableURL:url]; [self updateProperties]; QCocoaMenuBar::redirectKnownMenuItemsToFirstResponder(); @@ -290,26 +292,24 @@ static QString strippedText(QString s) }]; } -- (BOOL)isHiddenFile:(NSString *)filename isDir:(BOOL)isDir +- (BOOL)isHiddenFileAtURL:(NSURL *)url { - CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)filename, kCFURLPOSIXPathStyle, isDir); - CFBooleanRef isHidden; - Boolean errorOrHidden = false; - if (!CFURLCopyResourcePropertyForKey(url, kCFURLIsHiddenKey, &isHidden, NULL)) { - errorOrHidden = true; - } else { - if (CFBooleanGetValue(isHidden)) - errorOrHidden = true; - CFRelease(isHidden); + BOOL hidden = NO; + if (url) { + CFBooleanRef isHiddenProperty; + if (CFURLCopyResourcePropertyForKey((__bridge CFURLRef)url, kCFURLIsHiddenKey, &isHiddenProperty, NULL)) { + hidden = CFBooleanGetValue(isHiddenProperty); + CFRelease(isHiddenProperty); + } } - CFRelease(url); - return errorOrHidden; + return hidden; } -- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename +- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url { Q_UNUSED(sender); + NSString *filename = [url path]; if ([filename length] == 0) return NO; @@ -353,7 +353,7 @@ static QString strippedText(QString s) return NO; } if (!(filter & QDir::Hidden) - && (qtFileName.startsWith(QLatin1Char('.')) || [self isHiddenFile:filename isDir:isDir])) + && (qtFileName.startsWith(QLatin1Char('.')) || [self isHiddenFileAtURL:url])) return NO; return YES; @@ -446,11 +446,15 @@ static QString strippedText(QString s) [mSavePanel setTitle:mOptions->windowTitle().toNSString()]; [mPopUpButton setHidden:chooseDirsOnly]; // TODO hide the whole sunken pane instead? - QStringList ext = [self acceptableExtensionsForSave]; - const QString defaultSuffix = mOptions->defaultSuffix(); - if (!ext.isEmpty() && !defaultSuffix.isEmpty()) - ext.prepend(defaultSuffix); - [mSavePanel setAllowedFileTypes:ext.isEmpty() ? nil : qt_mac_QStringListToNSMutableArray(ext)]; + if (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) { + QStringList ext = [self acceptableExtensionsForSave]; + const QString defaultSuffix = mOptions->defaultSuffix(); + if (!ext.isEmpty() && !defaultSuffix.isEmpty()) + ext.prepend(defaultSuffix); + [mSavePanel setAllowedFileTypes:ext.isEmpty() ? nil : qt_mac_QStringListToNSMutableArray(ext)]; + } else { + [mOpenPanel setAllowedFileTypes:nil]; // delegate panel:shouldEnableURL: does the file filtering for NSOpenPanel + } if ([mSavePanel respondsToSelector:@selector(isVisible)] && [mSavePanel isVisible]) { if ([mSavePanel respondsToSelector:@selector(validateVisibleColumns)]) diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 9dfcb82151..d48ec8c6f7 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -69,6 +69,9 @@ static void initResources() QT_BEGIN_NAMESPACE +class QCoreTextFontEngine; +class QFontEngineFT; + QCocoaScreen::QCocoaScreen(int screenIndex) : QPlatformScreen(), m_screenIndex(screenIndex), m_refreshRate(60.0) { @@ -302,7 +305,7 @@ QCocoaIntegration *QCocoaIntegration::mInstance = 0; QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) : mOptions(parseOptions(paramList)) - , mFontDb(new QCoreTextFontDatabase(mOptions.testFlag(UseFreeTypeFontEngine))) + , mFontDb(0) #ifndef QT_NO_ACCESSIBILITY , mAccessibility(new QCocoaAccessibility) #endif @@ -318,6 +321,13 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) qWarning("Creating multiple Cocoa platform integrations is not supported"); mInstance = this; +#ifndef QT_NO_FREETYPE + if (mOptions.testFlag(UseFreeTypeFontEngine)) + mFontDb.reset(new QCoreTextFontDatabaseEngineFactory<QFontEngineFT>); + else +#endif + mFontDb.reset(new QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>); + QString icStr = QPlatformInputContextFactory::requested(); icStr.isNull() ? mInputContext.reset(new QCocoaInputContext) : mInputContext.reset(QPlatformInputContextFactory::create(icStr)); diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp index 1abc430da6..5e2708e958 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorintegration.cpp @@ -97,7 +97,9 @@ void QEglFSEmulatorIntegration::screenInit() } } } else { - qWarning() << "eglfs_emu: Failed to parse display info JSON with error: " << error.errorString(); + qWarning() << "eglfs_emu: Failed to parse display info JSON with error: " << error.errorString() + << " at offset " << error.offset << " : " << displaysInfo; + } } else { qFatal("EGL library doesn't support Emulator extensions"); diff --git a/src/plugins/platforms/ios/qiosintegration.mm b/src/plugins/platforms/ios/qiosintegration.mm index fbf167b514..5c42828885 100644 --- a/src/plugins/platforms/ios/qiosintegration.mm +++ b/src/plugins/platforms/ios/qiosintegration.mm @@ -69,13 +69,15 @@ QT_BEGIN_NAMESPACE +class QCoreTextFontEngine; + QIOSIntegration *QIOSIntegration::instance() { return static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration()); } QIOSIntegration::QIOSIntegration() - : m_fontDatabase(new QCoreTextFontDatabase) + : m_fontDatabase(new QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>) #if !defined(Q_OS_TVOS) && !defined(QT_NO_CLIPBOARD) , m_clipboard(new QIOSClipboard) #endif diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp index aa0037f187..ca33689cd7 100644 --- a/src/plugins/platforms/minimal/qminimalintegration.cpp +++ b/src/plugins/platforms/minimal/qminimalintegration.cpp @@ -44,7 +44,7 @@ #include <QtGui/private/qguiapplication_p.h> #include <qpa/qplatformwindow.h> -#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h> +#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h> #if defined(Q_OS_WINRT) # include <QtFontDatabaseSupport/private/qwinrtfontdatabase_p.h> #elif defined(Q_OS_WIN) @@ -69,6 +69,8 @@ QT_BEGIN_NAMESPACE +class QCoreTextFontEngine; + static const char debugBackingStoreEnvironmentVariable[] = "QT_DEBUG_BACKINGSTORE"; static inline unsigned parseOptions(const QStringList ¶mList) @@ -140,7 +142,7 @@ QPlatformFontDatabase *QMinimalIntegration::fontDatabase() const m_fontDatabase = new QWindowsFontDatabase; } #elif defined(Q_OS_DARWIN) - m_fontDatabase = new QCoreTextFontDatabase; + m_fontDatabase = new QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine>; #else m_fontDatabase = QPlatformIntegration::fontDatabase(); #endif diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp index 56e6075cb2..0c39950019 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp @@ -49,7 +49,7 @@ #include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h> #endif #elif defined(Q_OS_WIN) -#include <QtFontDatabaseSupport/private/qbasicfontdatabase_p.h> +#include <QtFontDatabaseSupport/private/qfreetypefontdatabase_p.h> #ifndef Q_OS_WINRT #include <QtCore/private/qeventdispatcher_win_p.h> #else @@ -103,7 +103,7 @@ QOffscreenIntegration::QOffscreenIntegration() m_fontDatabase.reset(new QGenericUnixFontDatabase()); #endif #elif defined(Q_OS_WIN) - m_fontDatabase.reset(new QBasicFontDatabase()); + m_fontDatabase.reset(new QFreeTypeFontDatabase()); #endif #ifndef QT_NO_DRAGANDDROP diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp index c37d869597..832e94034d 100644 --- a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp @@ -157,10 +157,13 @@ QMargins QOffscreenWindow::frameMargins() const void QOffscreenWindow::setFrameMarginsEnabled(bool enabled) { - if (enabled && !(window()->flags() & Qt::FramelessWindowHint)) + if (enabled + && !(window()->flags() & Qt::FramelessWindowHint) + && (parent() == nullptr)) { m_margins = QMargins(2, 2, 2, 2); - else + } else { m_margins = QMargins(0, 0, 0, 0); + } } void QOffscreenWindow::setWindowState(Qt::WindowStates state) diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp index 025112c790..8516e994f5 100644 --- a/src/plugins/platforms/vnc/qvncintegration.cpp +++ b/src/plugins/platforms/vnc/qvncintegration.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** -** This file is part of the FOO module of the Qt Toolkit. +** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/plugins/platforms/winrt/qwinrtdrag.cpp b/src/plugins/platforms/winrt/qwinrtdrag.cpp index 49a0f2c35b..43c406e1fb 100644 --- a/src/plugins/platforms/winrt/qwinrtdrag.cpp +++ b/src/plugins/platforms/winrt/qwinrtdrag.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/plugins/platforms/winrt/qwinrtdrag.h b/src/plugins/platforms/winrt/qwinrtdrag.h index 71eb2ea418..2371201507 100644 --- a/src/plugins/platforms/winrt/qwinrtdrag.h +++ b/src/plugins/platforms/winrt/qwinrtdrag.h @@ -1,34 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** Foundation and appearing in the file LICENSE.LGPL3 included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index d9add22e00..bcd6e46fc6 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -693,7 +693,7 @@ void QGLXContext::queryDummyContext() if (const char *renderer = (const char *) glGetString(GL_RENDERER)) { for (int i = 0; qglx_threadedgl_blacklist_renderer[i]; ++i) { if (strstr(renderer, qglx_threadedgl_blacklist_renderer[i]) != 0) { - qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " + qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " "blacklisted renderer \"" << qglx_threadedgl_blacklist_renderer[i] << "\""; @@ -706,7 +706,7 @@ void QGLXContext::queryDummyContext() if (glxvendor) { for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) { if (strstr(glxvendor, qglx_threadedgl_blacklist_vendor[i]) != 0) { - qCInfo(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " + qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " "blacklisted vendor \"" << qglx_threadedgl_blacklist_vendor[i] << "\""; @@ -722,7 +722,7 @@ void QGLXContext::queryDummyContext() oldContext->makeCurrent(oldSurface); if (!m_supportsThreading) { - qCInfo(lcQpaGl) << "Force-enable multithreaded OpenGL by setting " + qCDebug(lcQpaGl) << "Force-enable multithreaded OpenGL by setting " "environment variable QT_OPENGL_NO_SANITY_CHECK"; } } diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index d7eeb5d118..c2e4edf2d5 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1092,7 +1092,9 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) break; case XCB_SELECTION_REQUEST: { +#if QT_CONFIG(draganddrop) || QT_CONFIG(clipboard) xcb_selection_request_event_t *sr = reinterpret_cast<xcb_selection_request_event_t *>(event); +#endif #ifndef QT_NO_DRAGANDDROP if (sr->selection == atom(QXcbAtom::XdndSelection)) m_drag->handleSelectionRequest(sr); @@ -1285,9 +1287,9 @@ void QXcbEventReader::unlock() m_mutex.unlock(); } -void QXcbConnection::setFocusWindow(QXcbWindow *w) +void QXcbConnection::setFocusWindow(QWindow *w) { - m_focusWindow = w; + m_focusWindow = w ? static_cast<QXcbWindow *>(w->handle()) : nullptr; } void QXcbConnection::setMouseGrabber(QXcbWindow *w) { diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index cdd8e64676..512a1d09b9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -480,7 +480,7 @@ public: Qt::MouseButton translateMouseButton(xcb_button_t s); QXcbWindow *focusWindow() const { return m_focusWindow; } - void setFocusWindow(QXcbWindow *); + void setFocusWindow(QWindow *); QXcbWindow *mouseGrabber() const { return m_mouseGrabber; } void setMouseGrabber(QXcbWindow *); QXcbWindow *mousePressWindow() const { return m_mousePressWindow; } diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp index 186f31e08a..2848446098 100644 --- a/src/plugins/platforms/xcb/qxcbmime.cpp +++ b/src/plugins/platforms/xcb/qxcbmime.cpp @@ -44,12 +44,6 @@ #include <QtCore/QBuffer> #include <qdebug.h> -#include <X11/Xutil.h> - -#undef XCB_ATOM_STRING -#undef XCB_ATOM_PIXMAP -#undef XCB_ATOM_BITMAP - QT_BEGIN_NAMESPACE #if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD)) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index db6ade5662..ff4408e3f1 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -284,6 +284,8 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s) free_prop = false; #if QT_CONFIG(textcodec) } +#else + Q_UNUSED(dpy); #endif return &tp; } @@ -916,7 +918,7 @@ void QXcbWindow::doFocusIn() if (relayFocusToModalWindow()) return; QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver(); - connection()->setFocusWindow(static_cast<QXcbWindow *>(w->handle())); + connection()->setFocusWindow(w); QWindowSystemInterface::handleWindowActivated(w, Qt::ActiveWindowFocusReason); } @@ -924,7 +926,7 @@ static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event { if (!event) { // FocusIn event is not in the queue, proceed with FocusOut normally. - QWindowSystemInterface::handleWindowActivated(0, Qt::ActiveWindowFocusReason); + QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason); return true; } uint response_type = event->response_type & ~0x80; @@ -949,12 +951,10 @@ static bool focusInPeeker(QXcbConnection *connection, xcb_generic_event_t *event void QXcbWindow::doFocusOut() { - if (relayFocusToModalWindow()) - return; - connection()->setFocusWindow(0); - // Do not set the active window to 0 if there is a FocusIn coming. - // There is however no equivalent for XPutBackEvent so register a - // callback for QXcbConnection instead. + connection()->setFocusWindow(nullptr); + relayFocusToModalWindow(); + // Do not set the active window to nullptr if there is a FocusIn coming. + // The FocusIn handler will update QXcbConnection::setFocusWindow() accordingly. connection()->addPeekFunc(focusInPeeker); } @@ -2746,14 +2746,14 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event) reason = Qt::OtherFocusReason; break; } - connection()->setFocusWindow(static_cast<QXcbWindow*>(window()->handle())); + connection()->setFocusWindow(window()); QWindowSystemInterface::handleWindowActivated(window(), reason); break; case XEMBED_FOCUS_OUT: if (window() == QGuiApplication::focusWindow() && !activeWindowChangeQueued(window())) { - connection()->setFocusWindow(0); - QWindowSystemInterface::handleWindowActivated(0); + connection()->setFocusWindow(nullptr); + QWindowSystemInterface::handleWindowActivated(nullptr); } break; } |