[M120 Migration] Add mouseout event 48/308248/3
authorfangfengrong <fr.fang@samsung.com>
Fri, 15 Mar 2024 11:53:11 +0000 (19:53 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 26 Mar 2024 03:10:11 +0000 (03:10 +0000)
On webbrowser internal page (featured, most-visited, Bookmarks, watch later),
when move mouse out of the webpage, the Blue Highlight remains in webpage.

It caused by no mouse out event being delivered to js.

So, keep same with M94, when receive the mouse out event callback from EFL,
create a standard mouse out event and deliver it to js.
refer:
https://review.tizen.org/gerrit/#/c/297166

Change-Id: Id27837f957b633b594a15def0e185c6138502ca4
Signed-off-by: fangfengrong <fr.fang@samsung.com>
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