summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:34:32 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:36:10 -0700
commitd38fe875c7850ca2c6ca28f91e94ae276735fac8 (patch)
treee5c92cef74e0853490d77cf0139b23f00d548a6e /src/plugins/platforms
parentac4e848c9802377b7c4ff673180f28b9ca76b746 (diff)
parent627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/cocoa.pro7
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm16
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm16
-rw-r--r--src/plugins/platforms/windows/openglblacklists/default.json12
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp18
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp6
-rw-r--r--src/plugins/platforms/winrt/qwinrtfileengine.cpp3
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri7
12 files changed, 96 insertions, 32 deletions
diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro
index f48f9ccf30..1e6ea70161 100644
--- a/src/plugins/platforms/cocoa/cocoa.pro
+++ b/src/plugins/platforms/cocoa/cocoa.pro
@@ -21,7 +21,6 @@ OBJECTIVE_SOURCES += main.mm \
qmultitouch_mac.mm \
qcocoaaccessibilityelement.mm \
qcocoaaccessibility.mm \
- qcocoafontdialoghelper.mm \
qcocoacursor.mm \
qcocoaclipboard.mm \
qcocoadrag.mm \
@@ -55,7 +54,6 @@ HEADERS += qcocoaintegration.h \
qmultitouch_mac_p.h \
qcocoaaccessibilityelement.h \
qcocoaaccessibility.h \
- qcocoafontdialoghelper.h \
qcocoacursor.h \
qcocoaclipboard.h \
qcocoadrag.h \
@@ -111,6 +109,11 @@ qtHaveModule(widgets) {
HEADERS += qcocoafiledialoghelper.h
}
+ qtConfig(fontdialog) {
+ SOURCES += qcocoafontdialoghelper.mm
+ HEADERS += qcocoafontdialoghelper.h
+ }
+
QT += widgets-private printsupport-private
}
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
index 8b05cb7933..c3fad7cfd6 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.h
@@ -41,8 +41,11 @@
#define QCOCOAFONTDIALOGHELPER_H
#include <QObject>
+#include <QtWidgets/qtwidgetsglobal.h>
#include <qpa/qplatformdialoghelper.h>
+QT_REQUIRE_CONFIG(fontdialog);
+
QT_BEGIN_NAMESPACE
class QCocoaFontDialogHelper : public QPlatformFontDialogHelper
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index e4b796dcde..dbd7e90dba 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -37,8 +37,6 @@
**
****************************************************************************/
-#ifndef QT_NO_FONTDIALOG
-
#include <QtCore/qtimer.h>
#include <QtGui/qfontdatabase.h>
#include <qpa/qplatformtheme.h>
@@ -402,5 +400,3 @@ QFont QCocoaFontDialogHelper::currentFont() const
}
QT_END_NAMESPACE
-
-#endif // QT_NO_FONTDIALOG
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index a6104d86cc..fd627e3796 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -44,8 +44,6 @@
#include <QtCore/QVariant>
-#include "qcocoacolordialoghelper.h"
-#include "qcocoafontdialoghelper.h"
#include "qcocoasystemsettings.h"
#include "qcocoasystemtrayicon.h"
#include "qcocoamenuitem.h"
@@ -64,9 +62,15 @@
#ifdef QT_WIDGETS_LIB
#include <QtWidgets/qtwidgetsglobal.h>
+#if QT_CONFIG(colordialog)
+#include "qcocoacolordialoghelper.h"
+#endif
#if QT_CONFIG(filedialog)
#include "qcocoafiledialoghelper.h"
#endif
+#if QT_CONFIG(fontdialog)
+#include "qcocoafontdialoghelper.h"
+#endif
#endif
#include <Carbon/Carbon.h>
@@ -130,11 +134,11 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const
{
if (dialogType == QPlatformTheme::FileDialog)
return true;
-#if QT_CONFIG(colordialog)
+#if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog)
if (dialogType == QPlatformTheme::ColorDialog)
return true;
#endif
-#ifndef QT_NO_FONTDIALOG
+#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog)
if (dialogType == QPlatformTheme::FontDialog)
return true;
#endif
@@ -148,11 +152,11 @@ QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialo
case QPlatformTheme::FileDialog:
return new QCocoaFileDialogHelper();
#endif
-#if QT_CONFIG(colordialog)
+#if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog)
case QPlatformTheme::ColorDialog:
return new QCocoaColorDialogHelper();
#endif
-#ifndef QT_NO_FONTDIALOG
+#if defined(QT_WIDGETS_LIB) && QT_CONFIG(fontdialog)
case QPlatformTheme::FontDialog:
return new QCocoaFontDialogHelper();
#endif
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index ce74aa9973..e5041fb863 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -78,6 +78,22 @@
return m_cocoaWindow->screen()->availableGeometry().toCGRect();
}
+#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11)
+/*
+ AppKit on OS X 10.10 wrongly calls windowWillUseStandardFrame:defaultFrame
+ from -[NSWindow _frameForFullScreenMode] when going into fullscreen, resulting
+ in black bars on top and bottom of the window. By implementing the following
+ method, AppKit will choose that instead, and resolve the right fullscreen
+ geometry.
+*/
+- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
+{
+ Q_UNUSED(window);
+ Q_ASSERT(NSEqualSizes(m_cocoaWindow->screen()->geometry().size().toCGSize(), proposedSize));
+ return proposedSize;
+}
+#endif
+
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
Q_UNUSED(window);
diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json
index 69f4a54d05..6515f02830 100644
--- a/src/plugins/platforms/windows/openglblacklists/default.json
+++ b/src/plugins/platforms/windows/openglblacklists/default.json
@@ -126,6 +126,18 @@
"features": [
"disable_desktopgl"
]
+ },
+ {
+ "id": 11,
+ "description": "VMWare Workstation Player 12 has insufficient support for OpenGL",
+ "vendor_id": "0x15AD",
+ "device_id": [ "0x0405" ],
+ "os": {
+ "type": "win"
+ },
+ "features": [
+ "disable_desktopgl", "disable_d3d11"
+ ]
}
]
}
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 49c11ba2b7..36481b8ed7 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -844,6 +844,27 @@ static inline QWindowsInputContext *windowsInputContext()
return qobject_cast<QWindowsInputContext *>(QWindowsIntegration::instance()->inputContext());
}
+
+// Child windows, fixed-size windows or pop-ups and similar should not be resized
+static inline bool resizeOnDpiChanged(const QWindow *w)
+{
+ bool result = false;
+ if (w->isTopLevel()) {
+ switch (w->type()) {
+ case Qt::Window:
+ case Qt::Dialog:
+ case Qt::Sheet:
+ case Qt::Drawer:
+ case Qt::Tool:
+ result = !w->flags().testFlag(Qt::MSWindowsFixedSizeDialogHint);
+ break;
+ default:
+ break;
+ }
+ }
+ return result;
+}
+
/*!
\brief Main windows procedure registered for windows.
@@ -1118,9 +1139,8 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
#endif
} break;
case QtWindows::DpiChangedEvent: {
- if (platformWindow->window()->flags().testFlag(Qt::MSWindowsFixedSizeDialogHint))
- return false; // Fixed-size window should not be resized
-
+ if (!resizeOnDpiChanged(platformWindow->window()))
+ return false;
platformWindow->setFlag(QWindowsWindow::WithinDpiChanged);
const RECT *prcNewWindow = reinterpret_cast<RECT *>(lParam);
SetWindowPos(hwnd, NULL, prcNewWindow->left, prcNewWindow->top,
diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
index 24fb12d27a..3a4793efcd 100644
--- a/src/plugins/platforms/windows/qwindowsscreen.cpp
+++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
@@ -153,7 +153,8 @@ static QDebug operator<<(QDebug dbg, const QWindowsScreenData &d)
<< d.availableGeometry.width() << 'x' << d.availableGeometry.height() << '+' << d.availableGeometry.x() << '+' << d.availableGeometry.y()
<< " physical: " << d.physicalSizeMM.width() << 'x' << d.physicalSizeMM.height()
<< " DPI: " << d.dpi.first << 'x' << d.dpi.second << " Depth: " << d.depth
- << " Format: " << d.format;
+ << " Format: " << d.format
+ << " hMonitor: " << d.hMonitor;
if (d.flags & QWindowsScreenData::PrimaryScreen)
dbg << " primary";
if (d.flags & QWindowsScreenData::VirtualDesktop)
@@ -290,6 +291,13 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)
{
m_data.physicalSizeMM = newData.physicalSizeMM;
+ if (m_data.hMonitor != newData.hMonitor) {
+ qCDebug(lcQpaWindows) << "Monitor" << m_data.name
+ << "has had its hMonitor handle changed from"
+ << m_data.hMonitor << "to" << newData.hMonitor;
+ m_data.hMonitor = newData.hMonitor;
+ }
+
if (m_data.geometry != newData.geometry || m_data.availableGeometry != newData.availableGeometry) {
m_data.geometry = newData.geometry;
m_data.availableGeometry = newData.availableGeometry;
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 3165835d2d..a1ccf1f83c 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -869,12 +869,18 @@ QPixmap QWindowsFileIconEngine::filePixmap(const QSize &size, QIcon::Mode, QIcon
}
SHFILEINFO info;
- const unsigned int flags =
- SHGFI_ICON|iconSize|SHGFI_SYSICONINDEX|SHGFI_ADDOVERLAYS|SHGFI_OVERLAYINDEX;
-
- const bool val = cacheableDirIcon && useDefaultFolderIcon
- ? shGetFileInfoBackground(QString::fromWCharArray(L"dummy"), FILE_ATTRIBUTE_DIRECTORY, &info, flags | SHGFI_USEFILEATTRIBUTES)
- : shGetFileInfoBackground(filePath, 0, &info, flags);
+ unsigned int flags = SHGFI_ICON | iconSize | SHGFI_SYSICONINDEX | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX;
+ DWORD attributes = 0;
+ QString path = filePath;
+ if (cacheableDirIcon && useDefaultFolderIcon) {
+ flags |= SHGFI_USEFILEATTRIBUTES;
+ attributes |= FILE_ATTRIBUTE_DIRECTORY;
+ path = QStringLiteral("dummy");
+ } else if (!fileInfo().exists()) {
+ flags |= SHGFI_USEFILEATTRIBUTES;
+ attributes |= FILE_ATTRIBUTE_NORMAL;
+ }
+ const bool val = shGetFileInfoBackground(path, attributes, &info, flags);
// Even if GetFileInfo returns a valid result, hIcon can be empty in some cases
if (val && info.hIcon) {
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 25d50e6466..9c8a3d4956 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -39,7 +39,9 @@
#include "qwindowswindow.h"
#include "qwindowscontext.h"
-#include "qwindowsdrag.h"
+#if QT_CONFIG(draganddrop)
+# include "qwindowsdrag.h"
+#endif
#include "qwindowsscreen.h"
#include "qwindowsintegration.h"
#include "qwindowsmenu.h"
@@ -1834,6 +1836,8 @@ bool QWindowsWindow::isFullScreen_sys() const
if (!w->isTopLevel())
return false;
QRect geometry = geometry_sys();
+ if (testFlag(HasBorderInFullScreen))
+ geometry += QMargins(1, 1, 1, 1);
QPlatformScreen *screen = screenForGeometry(geometry);
return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen);
}
diff --git a/src/plugins/platforms/winrt/qwinrtfileengine.cpp b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
index dab2482ab3..58375d331c 100644
--- a/src/plugins/platforms/winrt/qwinrtfileengine.cpp
+++ b/src/plugins/platforms/winrt/qwinrtfileengine.cpp
@@ -426,8 +426,7 @@ QDateTime QWinRTFileEngine::fileTime(FileTime type) const
ComPtr<FileProperties::IBasicProperties> properties;
hr = QWinRTFunctions::await(op, properties.GetAddressOf());
RETURN_IF_FAILED("Failed to get file properties", return QDateTime());
- hr = type == ModificationTime ? properties->get_DateModified(&dateTime)
- : properties->get_ItemDate(&dateTime);
+ hr = properties->get_DateModified(&dateTime);
RETURN_IF_FAILED("Failed to get file date", return QDateTime());
}
break;
diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri
index df471f1105..98e48b706f 100644
--- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri
+++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri
@@ -5,10 +5,3 @@ INCLUDEPATH += $$PWD/../
load(qt_build_paths)
-!qtConfig(system-xcb) {
- QMAKE_USE += xcb-static xcb
-} else {
- qtConfig(xkb): QMAKE_USE += xcb_xkb
- qtConfig(xcb-render): QMAKE_USE += xcb_render
- QMAKE_USE += xcb_syslibs
-}