mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 00:19:18 +00:00
UI: Inform WebContent when the mouse leaves the WebView widget
Previously, when the mouse left the WebView, the currently hovered node would remain hovered (including the scroll bar). This felt a bit awkward and is not how other browsers behave.
This commit is contained in:
parent
8303a558f1
commit
bc4112bf18
Notes:
github-actions[bot]
2025-07-28 03:39:09 +00:00
Author: https://github.com/trflynn89
Commit: bc4112bf18
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5615
3 changed files with 20 additions and 1 deletions
|
@ -402,6 +402,16 @@ QVariant WebContentView::inputMethodQuery(Qt::InputMethodQuery) const
|
|||
return QVariant();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
QWidget::leaveEvent(event);
|
||||
}
|
||||
|
||||
void WebContentView::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
if (!m_tooltip_override) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue