LibWeb+UI: Add an explicit IPC to handle mouse leave events
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

The faux position we created here is adjusted by the device pixel ratio
later on, which would invoke integer overflow on screens with a DPR
greater than 1.

Instead of creating special data for a mouse move event, let's just add
an explicit leave event handler.
This commit is contained in:
Timothy Flynn 2025-07-28 12:57:31 -04:00 committed by Andreas Kling
commit 67cc02ab59
Notes: github-actions[bot] 2025-07-28 19:27:37 +00:00
11 changed files with 66 additions and 7 deletions

View file

@ -404,10 +404,8 @@ QVariant WebContentView::inputMethodQuery(Qt::InputMethodQuery) const
void WebContentView::leaveEvent(QEvent* event)
{
static constexpr QPointF point { NumericLimits<qreal>::max(), NumericLimits<qreal>::max() };
QMouseEvent mouse_event { QEvent::Type::MouseMove, point, point, Qt::MouseButton::NoButton, Qt::MouseButton::NoButton, Qt::KeyboardModifier::NoModifier };
enqueue_native_event(Web::MouseEvent::Type::MouseMove, mouse_event);
static QMouseEvent mouse_event { QEvent::Type::Leave, {}, {}, Qt::MouseButton::NoButton, Qt::MouseButton::NoButton, Qt::KeyboardModifier::NoModifier };
enqueue_native_event(Web::MouseEvent::Type::MouseLeave, mouse_event);
QWidget::leaveEvent(event);
}