diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 22:12:57 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-07 22:12:57 +0000 |
commit | ad0a64f962cf1fd6fc8f716c9afd7c9ba1b63009 (patch) | |
tree | 79fdbd30b279b00dad16aca8e9c6cbf9a1754ff0 /views/focus | |
parent | f3ef7b1c17b3f9a1db703a7b099e697e401d21a9 (diff) | |
download | chromium_src-ad0a64f962cf1fd6fc8f716c9afd7c9ba1b63009.zip chromium_src-ad0a64f962cf1fd6fc8f716c9afd7c9ba1b63009.tar.gz chromium_src-ad0a64f962cf1fd6fc8f716c9afd7c9ba1b63009.tar.bz2 |
Fixes bug in AcceleratorHandler. It's possible to get events for GtkWidgets
outside of those created by Chrome that we need to ignore. I saw this
with drag and drop.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/165150
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r-- | views/focus/accelerator_handler_gtk.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/views/focus/accelerator_handler_gtk.cc b/views/focus/accelerator_handler_gtk.cc index 938dfcc..16984ab 100644 --- a/views/focus/accelerator_handler_gtk.cc +++ b/views/focus/accelerator_handler_gtk.cc @@ -30,6 +30,11 @@ bool AcceleratorHandler::Dispatch(GdkEvent* event) { // with the top-level gtk widget. WindowGtk* widget = WidgetGtk::GetWindowForNative(reinterpret_cast<GtkWidget*>(ptr)); + if (!widget) { + // During dnd we get events for windows we don't control (such as the + // window being dragged). + return true; + } FocusManager* focus_manager = widget->GetFocusManager(); if (!focus_manager) { NOTREACHED(); |