From ad0a64f962cf1fd6fc8f716c9afd7c9ba1b63009 Mon Sep 17 00:00:00 2001 From: "sky@chromium.org" Date: Fri, 7 Aug 2009 22:12:57 +0000 Subject: 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 --- views/focus/accelerator_handler_gtk.cc | 5 +++++ 1 file changed, 5 insertions(+) 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(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(); -- cgit v1.1