Index: components/exo/pointer.h |
diff --git a/components/exo/pointer.h b/components/exo/pointer.h |
index 67a12efedb18f4ae457f3afc74bcf01d3dc7bf49..0757188311a94662ae9e53befd9c899e9e5e8547 100644 |
--- a/components/exo/pointer.h |
+++ b/components/exo/pointer.h |
@@ -14,6 +14,7 @@ |
#include "components/exo/surface_observer.h" |
#include "components/exo/wm_helper.h" |
#include "ui/base/cursor/cursor.h" |
+#include "ui/display/display.h" |
#include "ui/events/event_handler.h" |
#include "ui/gfx/geometry/point.h" |
#include "ui/gfx/geometry/point_f.h" |
@@ -58,6 +59,7 @@ class Pointer : public ui::EventHandler, |
// Overridden from WMHelper::CursorObserver: |
void OnCursorSetChanged(ui::CursorSetType cursor_set) override; |
+ void OnCursorDisplayChanging(const display::Display& display) override; |
// Overridden from SurfaceDelegate: |
void OnSurfaceCommit() override; |
@@ -70,9 +72,6 @@ class Pointer : public ui::EventHandler, |
// Returns the effective target for |event|. |
Surface* GetEffectiveTargetForEvent(ui::Event* event) const; |
- // Recompute cursor scale and update cursor if scale changed. |
- void UpdateCursorScale(); |
- |
// Asynchronously update the cursor by capturing a snapshot of |surface_|. |
void CaptureCursor(); |
@@ -80,8 +79,7 @@ class Pointer : public ui::EventHandler, |
void OnCursorCaptured(const gfx::Point& hotspot, |
std::unique_ptr<cc::CopyOutputResult> result); |
- // Update cursor to reflect the current value of |cursor_|. |
- void UpdateCursor(); |
+ void UpdateCursor(gfx::NativeCursor cursor); |
// The delegate instance that all events are dispatched to. |
PointerDelegate* const delegate_; |
@@ -95,14 +93,19 @@ class Pointer : public ui::EventHandler, |
// The location of the pointer in the current focus surface. |
gfx::PointF location_; |
- // The scale applied to the cursor to compensate for the UI scale. |
+ // The display-dependent scale applied to the cursor. |
+ float display_scale_ = 1.0f; |
+ |
+ // The display-independent scale applied to the cursor. |
float cursor_scale_ = 1.0f; |
+ // Device scale factor of the display where the mouse is located. |
+ float device_scale_factor_ = 1.0f; |
+ |
// The position of the pointer surface relative to the pointer location. |
gfx::Point hotspot_; |
- // The current cursor. |
- ui::Cursor cursor_; |
+ const std::unique_ptr<aura::Window> cursor_; |
// Source used for cursor capture copy output requests. |
const base::UnguessableToken cursor_capture_source_id_; |