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

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

Issue 2884463002: Make event-targeting asynchronous in window server. (Closed)
Patch Set: comments Created 3 years, 6 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 | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_manager_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_manager_state.h
diff --git a/services/ui/ws/window_manager_state.h b/services/ui/ws/window_manager_state.h
index 818c179238a7471530a3e768eb1d1fa217b4d44c..c936136b57553f1eac29392ea1745ee6478af5ad 100644
--- a/services/ui/ws/window_manager_state.h
+++ b/services/ui/ws/window_manager_state.h
@@ -100,7 +100,7 @@ class WindowManagerState : public EventDispatcherDelegate,
bool IsActive() const;
void Activate(const gfx::Point& mouse_location_on_display,
- const int64_t display_id);
+ int64_t display_id);
void Deactivate();
// Processes an event from PlatformDisplay.
@@ -157,13 +157,13 @@ class WindowManagerState : public EventDispatcherDelegate,
};
// Tracks state associated with an event being dispatched to a client.
- struct InFlightEventDetails {
- InFlightEventDetails(WindowManagerState* window_manager_state,
- WindowTree* tree,
- int64_t display_id,
- const Event& event,
- EventDispatchPhase phase);
- ~InFlightEventDetails();
+ struct InFlightEventDispatchDetails {
+ InFlightEventDispatchDetails(WindowManagerState* window_manager_state,
+ WindowTree* tree,
+ int64_t display_id,
+ const Event& event,
+ EventDispatchPhase phase);
+ ~InFlightEventDispatchDetails();
base::OneShotTimer timer;
WindowTree* tree;
@@ -217,15 +217,10 @@ class WindowManagerState : public EventDispatcherDelegate,
std::unique_ptr<ProcessedEventTarget> processed_event_target,
int64_t display_id);
- // Processes the next valid event in |event_queue_|. If the event has already
- // been processed it is dispatched, otherwise the event is passed to the
- // EventDispatcher for processing.
- void ProcessNextEventFromQueue();
-
// Dispatches the event to the appropriate client and starts the ack timer.
void DispatchInputEventToWindowImpl(ServerWindow* target,
ClientSpecificId client_id,
- const int64_t display_id,
+ int64_t display_id,
const Event& event,
base::WeakPtr<Accelerator> accelerator);
@@ -234,16 +229,15 @@ class WindowManagerState : public EventDispatcherDelegate,
// Finds the debug accelerator for |event| and if one is found calls
// HandleDebugAccelerator().
- void ProcessDebugAccelerator(const Event& event, const int64_t display_id);
+ void ProcessDebugAccelerator(const Event& event, int64_t display_id);
// Runs the specified debug accelerator.
- void HandleDebugAccelerator(DebugAcceleratorType type,
- const int64_t display_id);
+ void HandleDebugAccelerator(DebugAcceleratorType type, int64_t display_id);
// Called when waiting for an event or accelerator to be processed by |tree|.
void ScheduleInputEventTimeout(WindowTree* tree,
ServerWindow* target,
- const int64_t display_id,
+ int64_t display_id,
const Event& event,
EventDispatchPhase phase);
@@ -251,34 +245,36 @@ class WindowManagerState : public EventDispatcherDelegate,
// the input should be in display-physical-pixel space, and the output is in
// screen-dip space. Returns true if the |point| is successfully converted,
// false otherwise.
- bool ConvertPointToScreen(const int64_t display_id, gfx::Point* point);
+ bool ConvertPointToScreen(int64_t display_id, gfx::Point* point);
// EventDispatcherDelegate:
void OnAccelerator(uint32_t accelerator_id,
- const int64_t display_id,
+ int64_t display_id,
const Event& event,
AcceleratorPhase phase) override;
void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
- ServerWindow* GetFocusedWindowForEventDispatcher(
- const int64_t display_id) override;
+ ServerWindow* GetFocusedWindowForEventDispatcher(int64_t display_id) override;
void SetNativeCapture(ServerWindow* window) override;
void ReleaseNativeCapture() override;
void UpdateNativeCursorFromDispatcher() override;
void OnCaptureChanged(ServerWindow* new_capture,
ServerWindow* old_capture) override;
void OnMouseCursorLocationChanged(const gfx::Point& point,
- const int64_t display_id) override;
+ int64_t display_id) override;
void DispatchInputEventToWindow(ServerWindow* target,
ClientSpecificId client_id,
- const int64_t display_id,
+ int64_t display_id,
const Event& event,
Accelerator* accelerator) override;
+ // Processes the next valid event in |event_queue_|. If the event has already
+ // been processed it is dispatched, otherwise the event is passed to the
+ // EventDispatcher for processing.
+ void ProcessNextAvailableEvent() override;
ClientSpecificId GetEventTargetClientId(const ServerWindow* window,
bool in_nonclient_area) override;
ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display,
int64_t* display_id) override;
- void OnEventTargetNotFound(const Event& event,
- const int64_t display_id) override;
+ void OnEventTargetNotFound(const Event& event, int64_t display_id) override;
// ServerWindowObserver:
void OnWindowEmbeddedAppDisconnected(ServerWindow* window) override;
@@ -291,13 +287,16 @@ class WindowManagerState : public EventDispatcherDelegate,
bool got_frame_decoration_values_ = false;
mojom::FrameDecorationValuesPtr frame_decoration_values_;
+ // Events can go into this queue if there's a hit-test in flight in
+ // EventDispatcher or if we are actively dispatching an event.
std::queue<std::unique_ptr<QueuedEvent>> event_queue_;
std::vector<DebugAccelerator> debug_accelerators_;
// If non-null we're actively waiting for a response from a client for an
// event.
- std::unique_ptr<InFlightEventDetails> in_flight_event_details_;
+ std::unique_ptr<InFlightEventDispatchDetails>
+ in_flight_event_dispatch_details_;
EventDispatcher event_dispatcher_;
« no previous file with comments | « services/ui/ws/test_utils.h ('k') | services/ui/ws/window_manager_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698