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

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

Issue 2376583003: mus: Keep track of the drag cursor during DnD operations. (Closed)
Patch Set: style Created 4 years, 3 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
« services/ui/ws/drag_controller.h ('K') | « services/ui/ws/window_manager_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/window_manager_state.cc
diff --git a/services/ui/ws/window_manager_state.cc b/services/ui/ws/window_manager_state.cc
index 698ccf1b94872b0af247b6ffb80ba66fb6eb4420..7dc0ab30c20a689853bf597b4a01ea7256629659 100644
--- a/services/ui/ws/window_manager_state.cc
+++ b/services/ui/ws/window_manager_state.cc
@@ -189,6 +189,7 @@ void WindowManagerState::CancelDragDrop() {
void WindowManagerState::EndDragDrop() {
event_dispatcher_.EndDragDrop();
+ UpdateNativeCursorFromDispatcher();
}
void WindowManagerState::AddSystemModalWindow(ServerWindow* window) {
@@ -413,13 +414,7 @@ void WindowManagerState::DispatchInputEventToWindowImpl(
if (event.IsMousePointerEvent()) {
DCHECK(event_dispatcher_.mouse_cursor_source_window());
-
- int32_t cursor_id = 0;
- if (event_dispatcher_.GetCurrentMouseCursor(&cursor_id)) {
- WindowManagerDisplayRoot* display_root =
- display_manager()->GetWindowManagerDisplayRoot(target);
- display_root->display()->UpdateNativeCursor(cursor_id);
- }
+ UpdateNativeCursorFromDispatcher();
}
event_dispatch_phase_ = EventDispatchPhase::TARGET;
@@ -531,6 +526,14 @@ void WindowManagerState::ReleaseNativeCapture() {
platform_display_with_capture_ = nullptr;
}
+void WindowManagerState::UpdateNativeCursorFromDispatcher() {
+ int32_t cursor_id = 0;
+ if (event_dispatcher_.GetCurrentMouseCursor(&cursor_id)) {
+ for (Display* display : display_manager()->displays())
+ display->UpdateNativeCursor(cursor_id);
+ }
+}
+
void WindowManagerState::OnCaptureChanged(ServerWindow* new_capture,
ServerWindow* old_capture) {
window_server()->ProcessCaptureChanged(new_capture, old_capture);
« services/ui/ws/drag_controller.h ('K') | « services/ui/ws/window_manager_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698