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

Unified Diff: ui/aura_shell/desktop_event_filter.cc

Issue 8574033: Beginnings of Window Modality support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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_shell/desktop_event_filter.cc
===================================================================
--- ui/aura_shell/desktop_event_filter.cc (revision 110305)
+++ ui/aura_shell/desktop_event_filter.cc (working copy)
@@ -70,19 +70,17 @@
bool DesktopEventFilter::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
+ // We must always update the cursor, otherwise the cursor can get stuck if an
+ // event filter registered with us consumes the event.
+ if (event->type() == ui::ET_MOUSE_MOVED)
+ UpdateCursor(target, event);
+
if (FilterMouseEvent(target, event))
return true;
- switch (event->type()) {
- case ui::ET_MOUSE_PRESSED:
- ActivateIfNecessary(target, event);
- break;
- case ui::ET_MOUSE_MOVED:
- HandleMouseMoved(target, event);
- break;
- default:
- break;
- }
+ if (event->type() == ui::ET_MOUSE_PRESSED)
+ ActivateIfNecessary(target, event);
+
return false;
}
@@ -112,8 +110,8 @@
}
}
-void DesktopEventFilter::HandleMouseMoved(aura::Window* target,
- aura::MouseEvent* event) {
+void DesktopEventFilter::UpdateCursor(aura::Window* target,
+ aura::MouseEvent* event) {
gfx::NativeCursor cursor = target->GetCursor(event->location());
if (event->flags() & ui::EF_IS_NON_CLIENT) {
int window_component =

Powered by Google App Engine
This is Rietveld 408576698