OnDisplayConfigurationChanged();
}
-#if !defined(USE_OZONE)
void MouseCursorEventFilter::OnDisplayConfigurationChanged() {
// Extra check for |num_connected_displays()| is for SystemDisplayApiTest
// that injects MockScreen.
else
UpdateVerticalEdgeBounds();
}
-#endif
void MouseCursorEventFilter::OnMouseEvent(ui::MouseEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
root->GetHost()->MoveCursorToHostLocation(point_in_host);
}
-#if !defined(USE_OZONE)
bool MouseCursorEventFilter::WarpMouseCursorIfNecessary(ui::MouseEvent* event) {
if (!event->HasNativeEvent())
return false;
gfx::Point point_in_native =
ui::EventSystemLocationFromNative(event->native_event());
- gfx::Point point_in_screen = event->location();
aura::Window* target = static_cast<aura::Window*>(event->target());
+#if defined(USE_OZONE)
+ // TODO(dnicoara): crbug.com/415680 Move cursor warping into Ozone once Ozone
+ // has access to the logical display layout.
+ // Native events in Ozone are in the native window coordinate system. We need
+ // to translate them to get the global position.
+ point_in_native.Offset(target->GetHost()->GetBounds().x(),
+ target->GetHost()->GetBounds().y());
+#endif
+ gfx::Point point_in_screen = event->location();
::wm::ConvertPointToScreen(target, &point_in_screen);
return WarpMouseCursorInNativeCoords(point_in_native, point_in_screen);
return true;
}
-#endif
void MouseCursorEventFilter::UpdateHorizontalEdgeBounds() {
bool from_primary = Shell::GetPrimaryRootWindow() == drag_source_root_;
*dst_root = root_windows[0] == *src_root ? root_windows[1] : root_windows[0];
}
-#if !defined(USE_OZONE)
bool MouseCursorEventFilter::WarpMouseCursorIfNecessaryForTest(
aura::Window* target_root,
const gfx::Point& point_in_screen) {
target_root->GetHost()->ConvertPointToNativeScreen(&native);
return WarpMouseCursorInNativeCoords(native, point_in_screen);
}
-#endif
} // namespace ash