diff --git a/libraries/ZWidget/include/zwidget/core/widget.h b/libraries/ZWidget/include/zwidget/core/widget.h
index 50756bcadf..a889938c87 100644
--- a/libraries/ZWidget/include/zwidget/core/widget.h
+++ b/libraries/ZWidget/include/zwidget/core/widget.h
@@ -175,6 +175,7 @@ private:
 	std::unique_ptr<Canvas> DispCanvas;
 	Widget* FocusWidget = nullptr;
 	Widget* CaptureWidget = nullptr;
+	Widget* HoverWidget = nullptr;
 
 	Widget(const Widget&) = delete;
 	Widget& operator=(const Widget&) = delete;
diff --git a/libraries/ZWidget/src/core/widget.cpp b/libraries/ZWidget/src/core/widget.cpp
index 4d22c0607d..feac769a63 100644
--- a/libraries/ZWidget/src/core/widget.cpp
+++ b/libraries/ZWidget/src/core/widget.cpp
@@ -75,6 +75,19 @@ void Widget::MoveBefore(Widget* sibling)
 
 void Widget::DetachFromParent()
 {
+	for (Widget* cur = ParentObj; cur; cur = cur->ParentObj)
+	{
+		if (cur->FocusWidget == this)
+			cur->FocusWidget = nullptr;
+		if (cur->CaptureWidget == this)
+			cur->CaptureWidget = nullptr;
+		if (cur->HoverWidget == this)
+			cur->HoverWidget = nullptr;
+
+		if (cur->DispWindow)
+			break;
+	}
+
 	if (PrevSiblingObj)
 		PrevSiblingObj->NextSiblingObj = NextSiblingObj;
 	if (NextSiblingObj)
@@ -474,6 +487,14 @@ void Widget::OnWindowMouseMove(const Point& pos)
 		Widget* widget = ChildAt(pos);
 		if (!widget)
 			widget = this;
+
+		if (HoverWidget != widget)
+		{
+			if (HoverWidget)
+				HoverWidget->OnMouseLeave();
+			HoverWidget = widget;
+		}
+
 		widget->OnMouseMove(widget->MapFrom(this, pos));
 	}
 }