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

Side by Side Diff: services/ui/ws/window_manager_state.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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SERVICES_UI_WS_WINDOW_MANAGER_STATE_H_ 5 #ifndef SERVICES_UI_WS_WINDOW_MANAGER_STATE_H_
6 #define SERVICES_UI_WS_WINDOW_MANAGER_STATE_H_ 6 #define SERVICES_UI_WS_WINDOW_MANAGER_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 // TODO(sky): EventDispatcher is really an implementation detail and should 90 // TODO(sky): EventDispatcher is really an implementation detail and should
91 // not be exposed. 91 // not be exposed.
92 EventDispatcher* event_dispatcher() { return &event_dispatcher_; } 92 EventDispatcher* event_dispatcher() { return &event_dispatcher_; }
93 93
94 CursorState& cursor_state() { return cursor_state_; } 94 CursorState& cursor_state() { return cursor_state_; }
95 95
96 // Returns true if this is the WindowManager of the active user. 96 // Returns true if this is the WindowManager of the active user.
97 bool IsActive() const; 97 bool IsActive() const;
98 98
99 void Activate(const gfx::Point& mouse_location_on_screen); 99 void Activate(const gfx::Point& mouse_location_on_display,
100 const int64_t display_id);
100 void Deactivate(); 101 void Deactivate();
101 102
102 // Processes an event from PlatformDisplay. 103 // Processes an event from PlatformDisplay.
103 void ProcessEvent(const Event& event, int64_t display_id); 104 void ProcessEvent(const Event& event, int64_t display_id);
104 105
105 private: 106 private:
106 class ProcessedEventTarget; 107 class ProcessedEventTarget;
107 friend class Display; 108 friend class Display;
108 friend class test::WindowManagerStateTestApi; 109 friend class test::WindowManagerStateTestApi;
109 110
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 234
234 // Runs the specified debug accelerator. 235 // Runs the specified debug accelerator.
235 void HandleDebugAccelerator(DebugAcceleratorType type); 236 void HandleDebugAccelerator(DebugAcceleratorType type);
236 237
237 // Called when waiting for an event or accelerator to be processed by |tree|. 238 // Called when waiting for an event or accelerator to be processed by |tree|.
238 void ScheduleInputEventTimeout(WindowTree* tree, 239 void ScheduleInputEventTimeout(WindowTree* tree,
239 ServerWindow* target, 240 ServerWindow* target,
240 const Event& event, 241 const Event& event,
241 EventDispatchPhase phase); 242 EventDispatchPhase phase);
242 243
244 // Helper function to update |point| to be in screen coordinates.
245 bool ConvertPointToScreen(gfx::Point* point, const int64_t display_id);
246
243 // EventDispatcherDelegate: 247 // EventDispatcherDelegate:
244 void OnAccelerator(uint32_t accelerator_id, 248 void OnAccelerator(uint32_t accelerator_id,
245 const Event& event, 249 const Event& event,
246 AcceleratorPhase phase) override; 250 AcceleratorPhase phase) override;
247 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override; 251 void SetFocusedWindowFromEventDispatcher(ServerWindow* window) override;
248 ServerWindow* GetFocusedWindowForEventDispatcher() override; 252 ServerWindow* GetFocusedWindowForEventDispatcher() override;
249 void SetNativeCapture(ServerWindow* window) override; 253 void SetNativeCapture(ServerWindow* window) override;
250 void ReleaseNativeCapture() override; 254 void ReleaseNativeCapture() override;
251 void UpdateNativeCursorFromDispatcher() override; 255 void UpdateNativeCursorFromDispatcher() override;
252 void OnCaptureChanged(ServerWindow* new_capture, 256 void OnCaptureChanged(ServerWindow* new_capture,
253 ServerWindow* old_capture) override; 257 ServerWindow* old_capture) override;
254 void OnMouseCursorLocationChanged(const gfx::Point& point) override; 258 void OnMouseCursorLocationChanged(const gfx::Point& point,
259 const int64_t display_id) override;
255 void DispatchInputEventToWindow(ServerWindow* target, 260 void DispatchInputEventToWindow(ServerWindow* target,
256 ClientSpecificId client_id, 261 ClientSpecificId client_id,
257 const Event& event, 262 const Event& event,
258 Accelerator* accelerator) override; 263 Accelerator* accelerator) override;
259 ClientSpecificId GetEventTargetClientId(const ServerWindow* window, 264 ClientSpecificId GetEventTargetClientId(const ServerWindow* window,
260 bool in_nonclient_area) override; 265 bool in_nonclient_area) override;
261 ServerWindow* GetRootWindowContaining(gfx::Point* location) override; 266 ServerWindow* GetRootWindowContaining(gfx::Point* location_in_display,
267 int64_t* display_id) override;
262 void OnEventTargetNotFound(const Event& event) override; 268 void OnEventTargetNotFound(const Event& event) override;
263 269
264 // ServerWindowObserver: 270 // ServerWindowObserver:
265 void OnWindowEmbeddedAppDisconnected(ServerWindow* window) override; 271 void OnWindowEmbeddedAppDisconnected(ServerWindow* window) override;
266 272
267 // The single WindowTree this WindowManagerState is associated with. 273 // The single WindowTree this WindowManagerState is associated with.
268 // |window_tree_| owns this. 274 // |window_tree_| owns this.
269 WindowTree* window_tree_; 275 WindowTree* window_tree_;
270 276
271 // Set to true the first time SetFrameDecorationValues() is called. 277 // Set to true the first time SetFrameDecorationValues() is called.
(...skipping 10 matching lines...) Expand all
282 288
283 EventDispatcher event_dispatcher_; 289 EventDispatcher event_dispatcher_;
284 290
285 // PlatformDisplay that currently has capture. 291 // PlatformDisplay that currently has capture.
286 PlatformDisplay* platform_display_with_capture_ = nullptr; 292 PlatformDisplay* platform_display_with_capture_ = nullptr;
287 293
288 // All the active WindowManagerDisplayRoots. 294 // All the active WindowManagerDisplayRoots.
289 WindowManagerDisplayRoots window_manager_display_roots_; 295 WindowManagerDisplayRoots window_manager_display_roots_;
290 296
291 // Id of the display the current event being processed originated from. 297 // Id of the display the current event being processed originated from.
292 int64_t event_processing_display_id_ = 0; 298 int64_t event_processing_display_id_ = 0;
sky 2017/05/17 16:53:42 I had added this to avoid sending the display_id f
riajiang 2017/05/19 20:45:05 Removed event_processing_display_id_ and changed t
293 299
294 // Set of WindowManagerDisplayRoots corresponding to Displays that have been 300 // Set of WindowManagerDisplayRoots corresponding to Displays that have been
295 // destroyed. WindowManagerDisplayRoots are not destroyed immediately when 301 // destroyed. WindowManagerDisplayRoots are not destroyed immediately when
296 // the Display is destroyed to allow the client to destroy the window when it 302 // the Display is destroyed to allow the client to destroy the window when it
297 // wants to. Once the client destroys the window WindowManagerDisplayRoots is 303 // wants to. Once the client destroys the window WindowManagerDisplayRoots is
298 // destroyed. 304 // destroyed.
299 WindowManagerDisplayRoots orphaned_window_manager_display_roots_; 305 WindowManagerDisplayRoots orphaned_window_manager_display_roots_;
300 306
301 // All state regarding what the current cursor is. 307 // All state regarding what the current cursor is.
302 CursorState cursor_state_; 308 CursorState cursor_state_;
303 309
304 DISALLOW_COPY_AND_ASSIGN(WindowManagerState); 310 DISALLOW_COPY_AND_ASSIGN(WindowManagerState);
305 }; 311 };
306 312
307 } // namespace ws 313 } // namespace ws
308 } // namespace ui 314 } // namespace ui
309 315
310 #endif // SERVICES_UI_WS_WINDOW_MANAGER_STATE_H_ 316 #endif // SERVICES_UI_WS_WINDOW_MANAGER_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698