From 4caea33d8f5ac4f40cf261856d07d8ad797fc013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 12 Oct 2015 11:31:10 +0200 Subject: [Doc] Correct the name of WebEngineNewViewRequest::userInitiated QML property. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was named isUserInitiated, which is the name of the C++ method used internally, not the name of the QML property. Task-number: QTBUG-48699 Change-Id: I82d69e3c2e011f1cffadc106322709d2b22ef275 Reviewed-by: Topi Reiniƶ --- src/webengine/api/qquickwebenginenewviewrequest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webengine/api/qquickwebenginenewviewrequest.cpp b/src/webengine/api/qquickwebenginenewviewrequest.cpp index 68ea73208..f66a44e5f 100644 --- a/src/webengine/api/qquickwebenginenewviewrequest.cpp +++ b/src/webengine/api/qquickwebenginenewviewrequest.cpp @@ -69,7 +69,7 @@ QQuickWebEngineView::NewViewDestination QQuickWebEngineNewViewRequest::destinati } /*! - \qmlproperty bool WebEngineNewViewRequest::isUserInitiated + \qmlproperty bool WebEngineNewViewRequest::userInitiated Whether this window request was directly triggered as the result of a keyboard or mouse event. Use this property to block possibly unwanted \e popups. -- cgit v1.2.3 From 378c588ccb9659c1c5066ab0da7d956d3843751e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 9 Oct 2015 13:20:24 +0200 Subject: Add changes file. List the most relevant changes. Change-Id: Ia61bd528e443ede5bef75dd61e68adc3ae637bb1 Reviewed-by: Allan Sandfeld Jensen --- dist/changes-5.5.2 | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dist/changes-5.5.2 diff --git a/dist/changes-5.5.2 b/dist/changes-5.5.2 new file mode 100644 index 000000000..fe4b88cb0 --- /dev/null +++ b/dist/changes-5.5.2 @@ -0,0 +1,46 @@ +Qt 5.5.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.5.0. + +Qt 5.5 introduces many new features and improvements as well as bugfixes +over the 5.4.x series. For more details, refer to the online documentation +included in this distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.5 series is binary compatible with the 5.4.x series. +Applications compiled for 5.4 will continue to run with 5.5. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + +QtWebEngineCore +-------- + - [QTBUG-48309] Fixed old-style QObject connections to + QWebEngineDownloadItem::stateChanged. + - [QTBUG-47976] Fixed httpUserAgent setting after the view's + initialization. + - [QTBUG-48206] Parse suggested filename from content-disposition response + header field. + - Fixed crash on malformed URL (Chromium issue 533361). + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +OS X +---- + - [QTBUG-48228] Enabled 32 bit build. + +Windows +------- + - [QTBUG-48285] Fixed installation of PDB files. + -- cgit v1.2.3 From 9553493c55ff35215601de794e396605ae39a0e4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 22 Sep 2015 18:22:04 +0200 Subject: make the render process DPI-aware On Windows, system calls that retrieve screen properties (like GetSystemMetrics to get the size of a scroll bar button) are dependent on the DPI awareness setting of the calling process. The render process must use the same DPI awareness setting as the browser process. Retrieve the DPI awareness of the parent process in the render process and set it accordingly. Task-number: QTBUG-48380 Change-Id: Ic17d29d0f584e3cf230ac6ea2b08e3aa0d87ccdd Reviewed-by: Allan Sandfeld Jensen --- src/process/main.cpp | 8 +++ src/process/process.pro | 5 ++ src/process/support_win.cpp | 155 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 src/process/support_win.cpp diff --git a/src/process/main.cpp b/src/process/main.cpp index 446465ef7..8328c0022 100644 --- a/src/process/main.cpp +++ b/src/process/main.cpp @@ -146,8 +146,16 @@ int stat64_proxy(const char *path, struct stat64 *buf) #endif #endif // defined(OS_LINUX) +#ifdef Q_OS_WIN +void initDpiAwareness(); +#endif // defined(Q_OS_WIN) + int main(int argc, const char **argv) { +#ifdef Q_OS_WIN + initDpiAwareness(); +#endif + // QCoreApplication needs a non-const pointer, while the // ContentMain in Chromium needs the pointer to be const. QCoreApplication qtApplication(argc, const_cast(argv)); diff --git a/src/process/process.pro b/src/process/process.pro index 7844b1004..5526b0f1c 100644 --- a/src/process/process.pro +++ b/src/process/process.pro @@ -40,6 +40,11 @@ INCLUDEPATH += ../core SOURCES = main.cpp +win32 { + SOURCES += \ + support_win.cpp +} + contains(QT_CONFIG, qt_framework) { target.path = $$[QT_INSTALL_LIBS]/QtWebEngineCore.framework/Versions/5/Helpers } else { diff --git a/src/process/support_win.cpp b/src/process/support_win.cpp new file mode 100644 index 000000000..4ccd51627 --- /dev/null +++ b/src/process/support_win.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $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. +** +** 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 +** 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. +** +** 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. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include + +class User32DLL { +public: + User32DLL() + : setProcessDPIAware(0) + { + library.setFileName(QStringLiteral("User32")); + if (!library.load()) + return; + setProcessDPIAware = (SetProcessDPIAware)library.resolve("SetProcessDPIAware"); + } + + bool isValid() const + { + return setProcessDPIAware; + } + + typedef BOOL (WINAPI *SetProcessDPIAware)(); + + // Windows Vista onwards + SetProcessDPIAware setProcessDPIAware; + +private: + QLibrary library; +}; + +// This must match PROCESS_DPI_AWARENESS in ShellScalingApi.h +enum DpiAwareness { + PROCESS_PER_UNAWARE = 0, + PROCESS_PER_SYSTEM_DPI_AWARE = 1, + PROCESS_PER_MONITOR_DPI_AWARE = 2 +}; + +// Shell scaling library (Windows 8.1 onwards) +class ShcoreDLL { +public: + ShcoreDLL() + : getProcessDpiAwareness(0), setProcessDpiAwareness(0) + { + if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8_1) + return; + library.setFileName(QStringLiteral("SHCore")); + if (!library.load()) + return; + getProcessDpiAwareness = (GetProcessDpiAwareness)library.resolve("GetProcessDpiAwareness"); + setProcessDpiAwareness = (SetProcessDpiAwareness)library.resolve("SetProcessDpiAwareness"); + } + + bool isValid() const + { + return getProcessDpiAwareness && setProcessDpiAwareness; + } + + typedef HRESULT (WINAPI *GetProcessDpiAwareness)(HANDLE, DpiAwareness *); + typedef HRESULT (WINAPI *SetProcessDpiAwareness)(DpiAwareness); + + GetProcessDpiAwareness getProcessDpiAwareness; + SetProcessDpiAwareness setProcessDpiAwareness; + +private: + QLibrary library; +}; + + +static DWORD getParentProcessId() +{ + HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + if (hSnapshot == INVALID_HANDLE_VALUE) { + qErrnoWarning(GetLastError(), "CreateToolhelp32Snapshot failed."); + return NULL; + } + + PROCESSENTRY32 pe = {0}; + pe.dwSize = sizeof(PROCESSENTRY32); + + if (!Process32First(hSnapshot, &pe)) { + qWarning("Cannot retrieve parent process handle."); + return NULL; + } + + DWORD parentPid = NULL; + const DWORD pid = GetCurrentProcessId(); + do { + if (pe.th32ProcessID == pid) { + parentPid = pe.th32ParentProcessID; + break; + } + } while (Process32Next(hSnapshot, &pe)); + CloseHandle(hSnapshot); + return parentPid; +} + +void initDpiAwareness() +{ + ShcoreDLL shcore; + if (shcore.isValid()) { + DpiAwareness dpiAwareness = PROCESS_PER_MONITOR_DPI_AWARE; + const DWORD pid = getParentProcessId(); + if (pid) { + HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid); + DpiAwareness parentDpiAwareness; + HRESULT hr = shcore.getProcessDpiAwareness(hProcess, &parentDpiAwareness); + CloseHandle(hProcess); + if (hr == S_OK) + dpiAwareness = parentDpiAwareness; + } + if (shcore.setProcessDpiAwareness(dpiAwareness) != S_OK) + qErrnoWarning(GetLastError(), "SetProcessDPIAwareness failed."); + } else { + // Fallback. Use SetProcessDPIAware unconditionally. + User32DLL user32; + if (user32.isValid()) + user32.setProcessDPIAware(); + } +} -- cgit v1.2.3 From b54b46c70fd7c092c30c748655389df44ba6ced9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 13 Oct 2015 10:56:37 +0200 Subject: Set off-the-record to true as documented The API had no way of setting off-the-record, because the constructor meant for it set it to false. The patch fixes the constructor and adds basic API tests for the QWebEngineProfiles. Change-Id: I407eb4a4b0524b6c4eb944d17d744620dd9db6fb Task-number: QTBUG-48724 Reviewed-by: Kai Koehne --- src/webenginewidgets/api/qwebengineprofile.cpp | 2 +- .../qwebengineprofile/qwebengineprofile.pro | 3 + .../qwebengineprofile/tst_qwebengineprofile.cpp | 76 ++++++++++++++++++++++ tests/auto/widgets/widgets.pro | 5 +- 4 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro create mode 100644 tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 2e5f685fd..fee57f5ec 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -193,7 +193,7 @@ void QWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info) */ QWebEngineProfile::QWebEngineProfile(QObject *parent) : QObject(parent) - , d_ptr(new QWebEngineProfilePrivate(new BrowserContextAdapter(false))) + , d_ptr(new QWebEngineProfilePrivate(new BrowserContextAdapter(true))) { d_ptr->q_ptr = this; } diff --git a/tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro b/tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro new file mode 100644 index 000000000..e56bbe8f7 --- /dev/null +++ b/tests/auto/widgets/qwebengineprofile/qwebengineprofile.pro @@ -0,0 +1,3 @@ +include(../tests.pri) +exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc +QT *= core-private gui-private diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp new file mode 100644 index 000000000..09929d33f --- /dev/null +++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtWebEngine module of the Qt Toolkit. +** +** $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. +** +** 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 +** 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. +** +** 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. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../util.h" +#include +#include + +class tst_QWebEngineProfile : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void defaultProfile(); + void profileConstructors(); +}; + +void tst_QWebEngineProfile::defaultProfile() +{ + QWebEngineProfile *profile = QWebEngineProfile::defaultProfile(); + QVERIFY(profile); + QVERIFY(!profile->isOffTheRecord()); + QCOMPARE(profile->storageName(), QStringLiteral("Default")); + QCOMPARE(profile->httpCacheType(), QWebEngineProfile::DiskHttpCache); + QCOMPARE(profile->persistentCookiesPolicy(), QWebEngineProfile::AllowPersistentCookies); +} + +void tst_QWebEngineProfile::profileConstructors() +{ + QWebEngineProfile otrProfile; + QWebEngineProfile diskProfile(QStringLiteral("Test")); + + QVERIFY(otrProfile.isOffTheRecord()); + QVERIFY(!diskProfile.isOffTheRecord()); + QCOMPARE(diskProfile.storageName(), QStringLiteral("Test")); + QCOMPARE(otrProfile.httpCacheType(), QWebEngineProfile::MemoryHttpCache); + QCOMPARE(diskProfile.httpCacheType(), QWebEngineProfile::DiskHttpCache); + QCOMPARE(otrProfile.persistentCookiesPolicy(), QWebEngineProfile::NoPersistentCookies); + QCOMPARE(diskProfile.persistentCookiesPolicy(), QWebEngineProfile::AllowPersistentCookies); + +} + +QTEST_MAIN(tst_QWebEngineProfile) +#include "tst_qwebengineprofile.moc" diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro index 2dbb498d1..2c8296cb8 100644 --- a/tests/auto/widgets/widgets.pro +++ b/tests/auto/widgets/widgets.pro @@ -6,8 +6,9 @@ SUBDIRS += \ qwebengineaccessibility \ qwebengineframe \ qwebenginepage \ - qwebenginehistoryinterface \ - qwebengineview \ qwebenginehistory \ + qwebenginehistoryinterface \ qwebengineinspector \ + qwebengineprofile \ qwebenginescript \ + qwebengineview -- cgit v1.2.3 From ce095e94b686196629244073990530441b9b5f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Wed, 14 Oct 2015 17:13:52 +0200 Subject: Update qtwebengine-chromium sha1. This is needed to include a fix for windows developer builds. Change-Id: I341167adc89e1dec05180f48194c0c22b3a3a77a Reviewed-by: Allan Sandfeld Jensen --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 305284960..705542779 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 305284960db83fe9b9ae47674db9914d82180c23 +Subproject commit 7055427796b506c44962d9332f7990136669c6a3 -- cgit v1.2.3 From cc3a0d7c39196937edf98c80d0c0a9f96443f6b6 Mon Sep 17 00:00:00 2001 From: Michael Bruning Date: Fri, 23 Oct 2015 14:04:43 +0200 Subject: Include memory leak fix in the 3rdparty submodule. Uses the backported fix from newer Chromium versions. Task-number: QTBUG-48822 Change-Id: If9c5746b350840ae1fdbd5331dd2abb8e6118b8a Reviewed-by: Florian Bruhin Reviewed-by: Kai Koehne --- src/3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/3rdparty b/src/3rdparty index 705542779..2ccb9f03c 160000 --- a/src/3rdparty +++ b/src/3rdparty @@ -1 +1 @@ -Subproject commit 7055427796b506c44962d9332f7990136669c6a3 +Subproject commit 2ccb9f03c534c28b1c3d2f2d09d131a70cdfe9f3 -- cgit v1.2.3 From 09a341f4a62a0fe244dc188a75d77d0067ad1fe7 Mon Sep 17 00:00:00 2001 From: Christophe Chapuis Date: Tue, 13 Oct 2015 23:15:51 +0200 Subject: Fix touch events coordinates when using custom devicePixelRatio Task-number: QTBUG-48766 Change-Id: Idcae6dc84829fe96db62c6cb30ab193873d36709 Reviewed-by: Kai Koehne Reviewed-by: Joerg Bornemann --- src/core/render_widget_host_view_qt.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 572bc340c..7c5ed64e7 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -182,12 +182,13 @@ static inline int flagsFromModifiers(Qt::KeyboardModifiers modifiers) class MotionEventQt : public ui::MotionEvent { public: - MotionEventQt(const QList &touchPoints, const base::TimeTicks &eventTime, Action action, const Qt::KeyboardModifiers modifiers, int index = -1) + MotionEventQt(const QList &touchPoints, const base::TimeTicks &eventTime, Action action, const Qt::KeyboardModifiers modifiers, float dpiScale, int index = -1) : touchPoints(touchPoints) , eventTime(eventTime) , action(action) , flags(flagsFromModifiers(modifiers)) , index(index) + , dpiScale(dpiScale) { // ACTION_DOWN and ACTION_UP must be accesssed through pointer_index 0 Q_ASSERT((action != ACTION_DOWN && action != ACTION_UP) || index == 0); @@ -198,8 +199,8 @@ public: virtual int GetActionIndex() const Q_DECL_OVERRIDE { return index; } virtual size_t GetPointerCount() const Q_DECL_OVERRIDE { return touchPoints.size(); } virtual int GetPointerId(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).id(); } - virtual float GetX(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).pos().x(); } - virtual float GetY(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).pos().y(); } + virtual float GetX(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).pos().x() / dpiScale; } + virtual float GetY(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).pos().y() / dpiScale; } virtual float GetRawX(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).screenPos().x(); } virtual float GetRawY(size_t pointer_index) const Q_DECL_OVERRIDE { return touchPoints.at(pointer_index).screenPos().y(); } virtual float GetTouchMajor(size_t pointer_index) const Q_DECL_OVERRIDE @@ -234,6 +235,7 @@ private: Action action; int flags; int index; + float dpiScale; }; RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget) @@ -999,7 +1001,7 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev) QList touchPoints = mapTouchPointIds(ev->touchPoints()); if (ev->type() == QEvent::TouchCancel) { - MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::ACTION_CANCEL, ev->modifiers()); + MotionEventQt cancelEvent(touchPoints, eventTimestamp, ui::MotionEvent::ACTION_CANCEL, ev->modifiers(), dpiScale()); processMotionEvent(cancelEvent); return; } @@ -1032,7 +1034,7 @@ void RenderWidgetHostViewQt::handleTouchEvent(QTouchEvent *ev) continue; } - MotionEventQt motionEvent(touchPoints, eventTimestamp, action, ev->modifiers(), i); + MotionEventQt motionEvent(touchPoints, eventTimestamp, action, ev->modifiers(), dpiScale(), i); processMotionEvent(motionEvent); } } -- cgit v1.2.3