Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,14 +1650,16 @@ static void webkitWebViewBaseLeave(WebKitWebViewBase* webViewBase, GdkCrossingMo
return;
#endif

if (!priv->lastMotionEvent)
return;

// We need to synthesize a fake mouse event here to let WebCore know that the mouse has left the
// web view. Let's compute a point outside the web view that is close to the previous
// coordinates of the pointer before it left the web view. First we'll figure out which
// coordinate is closest to an edge of the web view, then we'll adjust the coordinate to be one
// pixel outside the view. This is not necessarily the closest point outside the web view, but
// it's simple to calculate and surely good enough.

ASSERT(priv->lastMotionEvent);
int previousX = std::round(priv->lastMotionEvent->position.x());
int previousY = std::round(priv->lastMotionEvent->position.y());
int width = gtk_widget_get_width(GTK_WIDGET(webViewBase));
Expand Down