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

Unified Diff: ui/aura/shared/compound_event_filter.cc

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move HideHostCursor to x11_util.{cc,h} Created 8 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
Index: ui/aura/shared/compound_event_filter.cc
diff --git a/ui/aura/shared/compound_event_filter.cc b/ui/aura/shared/compound_event_filter.cc
index 6ddda9bd5dedc889042e06d5313b0352ad0b6367..0faf5e0fafd28bf1b250bd00d83dca0244882370 100644
--- a/ui/aura/shared/compound_event_filter.cc
+++ b/ui/aura/shared/compound_event_filter.cc
@@ -6,6 +6,7 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/cursor_client.h"
+#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/env.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/root_window.h"
@@ -86,9 +87,17 @@ size_t CompoundEventFilter::GetFilterCount() const {
// CompoundEventFilter, private:
void CompoundEventFilter::UpdateCursor(Window* target, ui::MouseEvent* event) {
- client::CursorClient* client =
- client::GetCursorClient(target->GetRootWindow());
- if (client) {
+ // If drag and drap is in progress, let the drag drop client set the cursor
+ // instead of setting the cursor here.
+ aura::RootWindow* root_window = target->GetRootWindow();
+ client::DragDropClient* drag_drop_client =
+ client::GetDragDropClient(root_window);
+ if (drag_drop_client && drag_drop_client->IsDragDropInProgress())
+ return;
+
+ client::CursorClient* cursor_client =
+ client::GetCursorClient(root_window);
+ if (cursor_client) {
gfx::NativeCursor cursor = target->GetCursor(event->location());
if (event->flags() & ui::EF_IS_NON_CLIENT) {
int window_component =
@@ -96,7 +105,9 @@ void CompoundEventFilter::UpdateCursor(Window* target, ui::MouseEvent* event) {
cursor = CursorForWindowComponent(window_component);
}
- client->SetCursor(cursor);
+ cursor_client->SetCursor(cursor);
+ cursor_client->SetDeviceScaleFactor(
+ root_window->AsRootWindowHostDelegate()->GetDeviceScaleFactor());
}
}

Powered by Google App Engine
This is Rietveld 408576698