From bd78753d625c573eef587fc0b8e767cffb99c2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 24 Mar 2020 09:39:06 +0100 Subject: [PATCH 1/3] widgets: Re-calculate focus frame style option after setting new geometry Fixes: QTBUG-83019 Change-Id: I75d3d93732cb0c5a5b7350f19f0227998bda4791 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qfocusframe.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/widgets/qfocusframe.cpp b/src/widgets/widgets/qfocusframe.cpp index c5b2a32aecd..6e453a92e9e 100644 --- a/src/widgets/widgets/qfocusframe.cpp +++ b/src/widgets/widgets/qfocusframe.cpp @@ -99,6 +99,8 @@ void QFocusFramePrivate::updateSize() return; q->setGeometry(geom); + + opt.rect = q->rect(); QStyleHintReturnMask mask; if (q->style()->styleHint(QStyle::SH_FocusFrame_Mask, &opt, q, &mask)) q->setMask(mask.region); From 3a6d8df5219653b043bd642668cee193f563ec84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 27 Mar 2020 10:49:31 +0100 Subject: [PATCH 2/3] Revert "wasm: Specify event targets by CSS selectors; Support emsdk >= 1.39.5" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c6da278271a2a3627b7a9933776cbdffc5bd2f23. This was a 5.15-only change which should not go into 5.14 since it raises the minimum supported emsdk version. Task-number: QTBUG-83098 Change-Id: I9e15952803f9dfff89b5b4e9caeff5c03dabca27 Reviewed-by: Morten Johan Sørvig --- .../platforms/wasm/qwasmeventtranslator.cpp | 25 ++++++++++--------- .../platforms/wasm/qwasmintegration.cpp | 9 +++---- .../platforms/wasm/qwasmopenglcontext.cpp | 3 +-- src/plugins/platforms/wasm/qwasmscreen.cpp | 4 +-- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp index 62ada796db3..d99c202c487 100644 --- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp +++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp @@ -339,7 +339,8 @@ QWasmEventTranslator::QWasmEventTranslator(QWasmScreen *screen) void QWasmEventTranslator::initEventHandlers() { - QByteArray canvasSelector = "#" + screen()->canvasId().toUtf8(); + QByteArray _canvasId = screen()->canvasId().toUtf8(); + const char *canvasId = _canvasId.constData(); // The Platform Detect: expand coverage and move as needed enum Platform { @@ -363,21 +364,21 @@ void QWasmEventTranslator::initEventHandlers() } } - emscripten_set_keydown_callback(canvasSelector.constData(), (void *)this, 1, &keyboard_cb); - emscripten_set_keyup_callback(canvasSelector.constData(), (void *)this, 1, &keyboard_cb); + emscripten_set_keydown_callback(canvasId, (void *)this, 1, &keyboard_cb); + emscripten_set_keyup_callback(canvasId, (void *)this, 1, &keyboard_cb); - emscripten_set_mousedown_callback(canvasSelector.constData(), (void *)this, 1, &mouse_cb); - emscripten_set_mouseup_callback(canvasSelector.constData(), (void *)this, 1, &mouse_cb); - emscripten_set_mousemove_callback(canvasSelector.constData(), (void *)this, 1, &mouse_cb); + emscripten_set_mousedown_callback(canvasId, (void *)this, 1, &mouse_cb); + emscripten_set_mouseup_callback(canvasId, (void *)this, 1, &mouse_cb); + emscripten_set_mousemove_callback(canvasId, (void *)this, 1, &mouse_cb); - emscripten_set_focus_callback(canvasSelector.constData(), (void *)this, 1, &focus_cb); + emscripten_set_focus_callback(canvasId, (void *)this, 1, &focus_cb); - emscripten_set_wheel_callback(canvasSelector.constData(), (void *)this, 1, &wheel_cb); + emscripten_set_wheel_callback(canvasId, (void *)this, 1, &wheel_cb); - emscripten_set_touchstart_callback(canvasSelector.constData(), (void *)this, 1, &touchCallback); - emscripten_set_touchend_callback(canvasSelector.constData(), (void *)this, 1, &touchCallback); - emscripten_set_touchmove_callback(canvasSelector.constData(), (void *)this, 1, &touchCallback); - emscripten_set_touchcancel_callback(canvasSelector.constData(), (void *)this, 1, &touchCallback); + emscripten_set_touchstart_callback(canvasId, (void *)this, 1, &touchCallback); + emscripten_set_touchend_callback(canvasId, (void *)this, 1, &touchCallback); + emscripten_set_touchmove_callback(canvasId, (void *)this, 1, &touchCallback); + emscripten_set_touchcancel_callback(canvasId, (void *)this, 1, &touchCallback); } template diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index f8eaa39f76d..69f58013e75 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -108,8 +108,9 @@ QWasmIntegration::QWasmIntegration() s_instance = this; // We expect that qtloader.js has populated Module.qtCanvasElements with one or more canvases. + // Also check Module.canvas, which may be set if the emscripen or a custom loader is used. emscripten::val qtCanvaseElements = val::module_property("qtCanvasElements"); - emscripten::val canvas = val::module_property("canvas"); // TODO: remove for Qt 6.0 + emscripten::val canvas = val::module_property("canvas"); if (!qtCanvaseElements.isUndefined()) { int screenCount = qtCanvaseElements["length"].as(); @@ -118,9 +119,7 @@ QWasmIntegration::QWasmIntegration() QString canvasId = QWasmString::toQString(canvas["id"]); addScreen(canvasId); } - } else if (!canvas.isUndefined()) { - qWarning() << "Module.canvas is deprecated. A future version of Qt will stop reading this property. " - << "Instead, set Module.qtCanvasElements to be an array of canvas elements, or use qtloader.js."; + } else if (!canvas.isUndefined()){ QString canvasId = QWasmString::toQString(canvas["id"]); addScreen(canvasId); } @@ -140,7 +139,7 @@ QWasmIntegration::QWasmIntegration() integration->resizeAllScreens(); return 0; }; - emscripten_set_resize_callback(EMSCRIPTEN_EVENT_TARGET_WINDOW, nullptr, 1, onWindowResize); + emscripten_set_resize_callback(nullptr, nullptr, 1, onWindowResize); } QWasmIntegration::~QWasmIntegration() diff --git a/src/plugins/platforms/wasm/qwasmopenglcontext.cpp b/src/plugins/platforms/wasm/qwasmopenglcontext.cpp index 4ddd56fd8ca..501ab99116a 100644 --- a/src/plugins/platforms/wasm/qwasmopenglcontext.cpp +++ b/src/plugins/platforms/wasm/qwasmopenglcontext.cpp @@ -106,8 +106,7 @@ EMSCRIPTEN_WEBGL_CONTEXT_HANDLE QWasmOpenGLContext::createEmscriptenContext(cons attributes.depth = useDepthStencil; attributes.stencil = useDepthStencil; - QByteArray convasSelector = "#" + canvasId.toUtf8(); - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(convasSelector.constData(), &attributes); + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = emscripten_webgl_create_context(canvasId.toUtf8().constData(), &attributes); return context; } diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp index 2788f1ac190..d407111c2f9 100644 --- a/src/plugins/platforms/wasm/qwasmscreen.cpp +++ b/src/plugins/platforms/wasm/qwasmscreen.cpp @@ -178,10 +178,10 @@ void QWasmScreen::updateQScreenAndCanvasRenderSize() // Setting the render size to a value larger than the CSS size enables high-dpi // rendering. - QByteArray canvasSelector = "#" + m_canvasId.toUtf8(); + QByteArray canvasId = m_canvasId.toUtf8(); double css_width; double css_height; - emscripten_get_element_css_size(canvasSelector.constData(), &css_width, &css_height); + emscripten_get_element_css_size(canvasId.constData(), &css_width, &css_height); QSizeF cssSize(css_width, css_height); QSizeF canvasSize = cssSize * devicePixelRatio(); From e03a3882bea83d19879b30e312cc1d24520ed540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 14 Apr 2020 16:44:42 +0200 Subject: [PATCH 3/3] QAuthenticator: Reset the authentication challenge Both Negotiate and NTLM are conditioned on the 'challenge' being empty when starting the authentication process. So let's reset it when we start the authentication process. Fixes: QTBUG-83370 Change-Id: I41af6d5bcfe3dd980ca2bedce10ceff4f61047ff Reviewed-by: Andy Shaw Reviewed-by: Timur Pocheptsov --- src/network/kernel/qauthenticator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index 33a30eb1cd6..4cc70b8d113 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -531,6 +531,7 @@ QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMet response = qNtlmPhase3(this, QByteArray::fromBase64(challenge)).toBase64(); phase = Done; } + challenge = ""; } break; @@ -560,6 +561,7 @@ QByteArray QAuthenticatorPrivate::calculateResponse(const QByteArray &requestMet if (!phase3Token.isEmpty()) { response = phase3Token.toBase64(); phase = Done; + challenge = ""; } }