diff options
author | vangelis@google.com <vangelis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 01:46:16 +0000 |
---|---|---|
committer | vangelis@google.com <vangelis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 01:46:16 +0000 |
commit | b82d98b9be4c2081bdd19adf4f2cbe4469e2dd20 (patch) | |
tree | 5c127271559e0f748487fa7e4fda9d0a9873d8f8 /o3d/core | |
parent | 0440d618824b73ff8444d3aa4177a0255709062f (diff) | |
download | chromium_src-b82d98b9be4c2081bdd19adf4f2cbe4469e2dd20.zip chromium_src-b82d98b9be4c2081bdd19adf4f2cbe4469e2dd20.tar.gz chromium_src-b82d98b9be4c2081bdd19adf4f2cbe4469e2dd20.tar.bz2 |
Fixing 'click' event handling:
http://code.google.com/p/o3d/issues/detail?id=98
Review URL: http://codereview.chromium.org/160051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21791 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core')
-rw-r--r-- | o3d/core/cross/event_manager.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/o3d/core/cross/event_manager.cc b/o3d/core/cross/event_manager.cc index 273566b..0712e4c 100644 --- a/o3d/core/cross/event_manager.cc +++ b/o3d/core/cross/event_manager.cc @@ -76,7 +76,12 @@ void EventManager::ClearEventCallback(Event::Type type) { void EventManager::AddEventToQueue(const Event& event) { // If we're shutting down or there's no callback registered to handle // this event type, we drop it. - if (valid_ && event_callbacks_[event.type()].IsSet()) { + // NOTE:If we have a callback registered for the click event then we allow + // MOUSEDOWN and MOUSEUP events through. + if (valid_ && (event_callbacks_[event.type()].IsSet() || + (event_callbacks_[Event::TYPE_CLICK].IsSet() && + (event.type() == Event::TYPE_MOUSEDOWN || + event.type() == Event::TYPE_MOUSEUP)))) { if (!event_queue_.empty()) { switch (event.type()) { case Event::TYPE_MOUSEMOVE: @@ -127,7 +132,8 @@ void EventManager::AddEventToQueue(const Event& event) { } } - event_queue_.push_back(event); + if (event_callbacks_[event.type()].IsSet()) + event_queue_.push_back(event); if (event.type() == Event::TYPE_MOUSEUP) { if (mousedown_in_plugin_ && event.in_plugin()) { |