summaryrefslogtreecommitdiffstats
path: root/views/focus
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-07 22:12:57 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-07 22:12:57 +0000
commitad0a64f962cf1fd6fc8f716c9afd7c9ba1b63009 (patch)
tree79fdbd30b279b00dad16aca8e9c6cbf9a1754ff0 /views/focus
parentf3ef7b1c17b3f9a1db703a7b099e697e401d21a9 (diff)
downloadchromium_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.cc5
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();