Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(583)

Unified Diff: services/ui/ws/event_dispatcher.h

Issue 2778943005: Keep root_location to be in pixels and display coordinates in WS. (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/ws/event_dispatcher.h
diff --git a/services/ui/ws/event_dispatcher.h b/services/ui/ws/event_dispatcher.h
index 8b084d7994f697a555d078ac1023b4dc5336f825..7890d14985a198c8eb178685a7660660ec3b6e87 100644
--- a/services/ui/ws/event_dispatcher.h
+++ b/services/ui/ws/event_dispatcher.h
@@ -59,10 +59,12 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// any events to the delegate.
void Reset();
- void SetMousePointerScreenLocation(const gfx::Point& screen_location);
+ void SetMousePointerDisplayLocationAndId(const gfx::Point& display_location,
sky 2017/05/17 16:53:41 optional: the new name is rather verbose. Leave th
riajiang 2017/05/19 20:45:05 Done.
+ const int64_t display_id);
const gfx::Point& mouse_pointer_last_location() const {
return mouse_pointer_last_location_;
}
+ int64_t mouse_pointer_display_id() const { return mouse_pointer_display_id_; }
// Returns the cursor for the current target, or POINTER if the mouse is not
// over a valid target.
@@ -142,7 +144,9 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// ANY and there is a matching accelerator with PRE_TARGET found, than only
// OnAccelerator() is called. The expectation is after the PRE_TARGET has been
// handled this is again called with an AcceleratorMatchPhase of POST_ONLY.
- void ProcessEvent(const ui::Event& event, AcceleratorMatchPhase match_phase);
+ void ProcessEvent(const ui::Event& event,
+ const int64_t display_id,
+ AcceleratorMatchPhase match_phase);
private:
friend class test::EventDispatcherTestApi;
@@ -186,7 +190,8 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
// when no buttons on the mouse are down.
// This also generates exit events as appropriate. For example, if the mouse
// moves between one window to another an exit is generated on the first.
- void ProcessPointerEvent(const ui::PointerEvent& event);
+ void ProcessPointerEvent(const ui::PointerEvent& event,
+ const int64_t display_id);
// Adds |pointer_target| to |pointer_targets_|.
void StartTrackingPointer(int32_t pointer_id,
@@ -234,7 +239,8 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
Accelerator* FindAccelerator(const ui::KeyEvent& event,
const ui::mojom::AcceleratorPhase phase);
- DeepestWindow FindDeepestVisibleWindowForEvents(const gfx::Point& location);
+ DeepestWindow FindDeepestVisibleWindowForEvents(gfx::Point* location,
+ int64_t* display_id);
// Clears the implicit captures in |pointer_targets_|, with the exception of
// |window|. |window| may be null. |client_id| is the target client of
@@ -265,9 +271,15 @@ class EventDispatcher : public ServerWindowObserver, public DragCursorUpdater {
ServerWindow* mouse_cursor_source_window_;
bool mouse_cursor_in_non_client_area_;
- // The on screen location of the mouse pointer. This can be outside the
- // bounds of |mouse_cursor_source_window_|, which can capture the cursor.
+ // The location of the mouse pointer in display coordinates. This can be
+ // outside the bounds of |mouse_cursor_source_window_|, which can capture the
+ // cursor.
gfx::Point mouse_pointer_last_location_;
+ // Id of the display |mouse_pointer_last_location_| is on.
+ int64_t mouse_pointer_display_id_ = 0;
+
+ // Id of the display the most recent event is on.
sky 2017/05/17 16:53:41 Under what circumstances is mouse_pointer_display_
riajiang 2017/05/19 20:45:05 We don't update mouse specific info (mouse_pointer
+ int64_t event_display_id_ = 0;
std::map<uint32_t, std::unique_ptr<Accelerator>> accelerators_;

Powered by Google App Engine
This is Rietveld 408576698