diff --git a/src/vte.cc b/src/vte.cc
index 30a4178b..48304d6c 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -7489,6 +7489,8 @@ VteTerminalPrivate::widget_enter(GdkEventCrossing *event)
 
         m_mouse_cursor_over_widget = TRUE;
         apply_mouse_cursor();
+
+        m_mouse_last_position = pos;
 }
 
 void
@@ -7507,6 +7509,8 @@ VteTerminalPrivate::widget_leave(GdkEventCrossing *event)
          */
         m_mouse_cursor_over_widget = FALSE;
         apply_mouse_cursor();
+
+        m_mouse_last_position = pos;
 }
 
 static G_GNUC_UNUSED inline const char *
