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

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

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: rebase and comments 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
« no previous file with comments | « no previous file | services/ui/ws/event_dispatcher.cc » ('j') | services/ui/ws/event_targeter.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/event_dispatcher.h
diff --git a/services/ui/ws/event_dispatcher.h b/services/ui/ws/event_dispatcher.h
index 1da07968bb4ba5868c01f88531e4509debdce0fd..a99a13d2d4ee546936e85fa8a6f6d0cf04178b05 100644
--- a/services/ui/ws/event_dispatcher.h
+++ b/services/ui/ws/event_dispatcher.h
@@ -62,8 +62,10 @@ class EventDispatcher : public ServerWindowObserver,
// any events to the delegate.
void Reset();
+ const EventTargeter* event_targeter() const { return event_targeter_.get(); }
sky 2017/06/02 23:28:20 EventTargeter is an implementation detail of Event
riajiang 2017/06/05 23:56:15 True, done.
+
void SetMousePointerDisplayLocation(const gfx::Point& display_location,
- const int64_t display_id);
+ int64_t display_id);
const gfx::Point& mouse_pointer_last_location() const {
return mouse_pointer_last_location_;
}
@@ -147,19 +149,33 @@ class EventDispatcher : public ServerWindowObserver,
// 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.
+ // This may be asynchronous if we need to find the target window for |event|
+ // asynchronously.
void ProcessEvent(const ui::Event& event,
- const int64_t display_id,
+ int64_t display_id,
AcceleratorMatchPhase match_phase);
// EventTargeterDelegate:
ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display,
int64_t* display_id) override;
+ void ProcessNextEventFromQueue() override;
private:
friend class test::EventDispatcherTestApi;
void SetMouseCursorSourceWindow(ServerWindow* window);
+ // Called after we found the target for the current mouse cursor to see if
+ // |mouse_pointer_last_location_| and |mouse_pointer_display_id_| need to be
+ // updated based on the new target we found. No need to call delegate's
+ // OnMouseCursorLocationChanged since mouse location is the same in
+ // screen-coord.
+ // TODO(riajiang): No need to update mouse location after ozone drm can tell
+ // us the right display the cursor is on for drag-n-drop events.
+ // crbug.com/726470
+ void SetMousePointerLocation(const gfx::Point& new_mouse_location,
+ int64_t new_mouse_display_id);
+
void ProcessKeyEvent(const ui::KeyEvent& event,
AcceleratorMatchPhase match_phase);
@@ -176,7 +192,24 @@ class EventDispatcher : public ServerWindowObserver,
// 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);
+ // |pointer_target| is the PointerTarget for |event| based on the
+ // |deepest_window|, the deepest visible window for the root_location
+ // of the |event|. |location_in_display| and |display_id| are updated values
+ // for root_location and |event_display_id_| (e.g. during drag-n-drop).
+ void ProcessPointerEventOnFoundTarget(const ui::PointerEvent& event,
+ const PointerTarget& pointer_target,
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ int64_t display_id);
+
+ void UpdateNonClientAreaForCurrentWindowOnFoundWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ int64_t display_id);
+ void UpdateCursorProviderByLastKnownLocationOnFoundWindow(
+ const DeepestWindow& deepest_window,
+ const gfx::Point& location_in_display,
+ int64_t display_id);
// Adds |pointer_target| to |pointer_targets_|.
void StartTrackingPointer(int32_t pointer_id,
@@ -189,7 +222,8 @@ class EventDispatcher : public ServerWindowObserver,
// pointer sends the appropriate event to the delegate and updates the
// currently tracked PointerTarget appropriately.
void UpdateTargetForPointer(int32_t pointer_id,
- const ui::LocatedEvent& event);
+ const ui::PointerEvent& event,
+ const PointerTarget& pointer_target);
// Returns true if any pointers are in the pressed/down state.
bool AreAnyPointersDown() const;
« no previous file with comments | « no previous file | services/ui/ws/event_dispatcher.cc » ('j') | services/ui/ws/event_targeter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698