diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-07-14 15:56:38 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2022-08-15 11:49:55 +0200 |
commit | d65c618915bfc7b08089c376d879e94cd567978f (patch) | |
tree | df678f9d512329967ee9cd9fbda5438ba3a22675 /cmake | |
parent | d052236a2fab08d52d2ba6dbd7780e8aaf1bfec0 (diff) | |
download | qtbase-d65c618915bfc7b08089c376d879e94cd567978f.tar.gz |
Refactor code focused around QWasmCompositor::processMouse
Refactoring of the logic around QWasmCompositor::processMouse has been
performed for readability and easier modification, in preparation for
further fixes for event delivery and handling in windows. There should
be no logic changes, just cleaner code.
Change groups:
Members of QWasmCompositor have been prefixed by m_ for easier discerning
of stateful and stateless variables in functions.
Variables renamed to more descriptive, e.g. window2->targetWindow,
globalPoint->targetPointInScreenCoords.
Magic numbers eliminated, e.g. mouseEvent->button == 0 is now
button == Qt::MouseButton::LeftButton.
Some common condition checks have been wrapped into single constants,
e.g. !(htmlWindow->m_windowState & Qt::WindowFullScreen) &&
!(htmlWindow->m_windowState & Qt::WindowMaximized) ==
isTargetWindowResizable
Some nested if-conditions were collapsed.
Some unnecessary checks have been moved to outer if conditions (e.g. for
draggedWindow in EMSCRIPTEN_EVENT_MOUSEMOVE, since the code would crash
anyway because only some parts are guarded against it being nullptr).
Consts introduced so that variables are only used for one purpose.
Made QWasmEventTranslator::translateMouseButton constexpr
Made QWasmWindow::isPointOnTitle behave correctly when the window has
no title bar so that no flag probing is needed prior to calling it.
Made QWasmCursor::setOverrideWasmCursor accept a const ref - having it
accept pointer suggested it might dangle.
Change-Id: I8910622fddad764ee86eb0260b5ad23c7ee7f97a
Reviewed-by: David Skoland <david.skoland@qt.io>
(cherry picked from commit ec58600cc923d6b7de5266e20e27d377fcc1540a)
Diffstat (limited to 'cmake')
0 files changed, 0 insertions, 0 deletions