Index: ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
index ca4fb27ae663333ef2d86ffa97a986a36d55a90c..6082c315678f2119bcb4dd29e85152cef8f97e9b 100644 |
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_x11.cc |
@@ -59,6 +59,18 @@ DEFINE_WINDOW_PROPERTY_KEY( |
namespace { |
+class ModifiedMouseEvent : public ui::MouseEvent { |
+ public: |
+ ModifiedMouseEvent(const ui::MouseEvent& event, ui::EventType type) |
+ : ui::MouseEvent(event, |
+ static_cast<View*>(NULL), |
+ static_cast<View*>(NULL)) { |
+ SetType(type); |
+ } |
+ |
+ virtual ~ModifiedMouseEvent() {} |
+}; |
+ |
// Standard Linux mouse buttons for going back and forward. |
const int kBackMouseButton = 8; |
const int kForwardMouseButton = 9; |
@@ -990,6 +1002,21 @@ bool DesktopRootWindowHostX11::Dispatch(const base::NativeEvent& event) { |
// May want to factor CheckXEventForConsistency(xev); into a common location |
// since it is called here. |
switch (xev->type) { |
+ case EnterNotify: { |
+ // Widget::OnMouseEvent ignores system mouse enter events since it's not |
+ // used on other platforms. We'll convert this to a mouse move event to be |
+ // consistent. Widget::OnMouseEvent will infer that this is actually a |
+ // mouse enter event and call the correct event handler. |
+ ui::MouseEvent mouse_event(xev); |
+ ModifiedMouseEvent(mouse_event, ui::ET_MOUSE_MOVED); |
+ DispatchMouseEvent(&mouse_event); |
+ break; |
+ } |
+ case LeaveNotify: { |
+ ui::MouseEvent mouse_event(xev); |
+ DispatchMouseEvent(&mouse_event); |
+ break; |
+ } |
case Expose: { |
gfx::Rect damage_rect(xev->xexpose.x, xev->xexpose.y, |
xev->xexpose.width, xev->xexpose.height); |