[M120 Migration] Add mouseout event
[platform/framework/web/chromium-efl.git] / tizen_src / chromium_impl / ui / ozone / platform / efl / efl_event_handler.cc
index 91ca651..862e74a 100644 (file)
@@ -565,6 +565,7 @@ void EflEventHandler::OnMouseIn(void* data,
                                 Evas* evas,
                                 Evas_Object* obj,
                                 void* event_info) {
+  LOG(INFO) << "OnMouseIn";
   EflEventHandler* thiz = static_cast<EflEventHandler*>(data);
   thiz->window_->UpdateFocus(true);
 }
@@ -574,10 +575,23 @@ void EflEventHandler::OnMouseOut(void* data,
                                  Evas* evas,
                                  Evas_Object* obj,
                                  void* event_info) {
-#if !BUILDFLAG(IS_TIZEN)
+  LOG(INFO) << "OnMouseOut";
   EflEventHandler* thiz = static_cast<EflEventHandler*>(data);
+#if !BUILDFLAG(IS_TIZEN)
   thiz->window_->UpdateFocus(false);
 #endif
+  Evas_Event_Mouse_Out* ev = static_cast<Evas_Event_Mouse_Out*>(event_info);
+
+  gfx::PointF root_location(ev->canvas.x, ev->canvas.y);
+  gfx::PointF location(ev->canvas.x, ev->canvas.y);
+  location.Offset(0, -thiz->GetTopControlsHeight());
+  int button = EvasToUIMouseButton(ev->buttons);
+  int event_flags = EvasModifiersToEventFlags(ev->modifiers);
+  event_flags |= button;
+  MouseEvent event(ET_MOUSE_EXITED, location, root_location,
+                   base::TimeTicks::Now(), event_flags, button);
+
+  EflPlatformEventSource::GetInstance()->DispatchEflEvent(&event);
 }
 
 // static