diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 19:31:45 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 19:31:45 +0000 |
commit | 27506acdd852ec19c67c566dc6a1e157e57a941a (patch) | |
tree | dba64313b9d1002102fec2c50308a8f27d849f90 /chrome/browser/gtk | |
parent | 2f5b1a172cf64e40d9e7ae97ef9ecb5ecd5fa865 (diff) | |
download | chromium_src-27506acdd852ec19c67c566dc6a1e157e57a941a.zip chromium_src-27506acdd852ec19c67c566dc6a1e157e57a941a.tar.gz chromium_src-27506acdd852ec19c67c566dc6a1e157e57a941a.tar.bz2 |
gtk: Grab the pointer when we grab focus for the source tab's widget. Fixes a crash where events were being sent to an unknown, unrealized widget.
BUG=18049
TEST=Quickly drag a tab down out of the tab strip. The browser should not crash.
Review URL: http://codereview.chromium.org/160379
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/tabs/tab_gtk.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/gtk/tabs/tab_gtk.cc b/chrome/browser/gtk/tabs/tab_gtk.cc index 90241100..a8a3ed6 100644 --- a/chrome/browser/gtk/tabs/tab_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_gtk.cc @@ -217,6 +217,10 @@ void TabGtk::OnDragBegin(GtkWidget* widget, GdkDragContext* context, // static void TabGtk::OnDragEnd(GtkWidget* widget, GdkDragContext* context, TabGtk* tab) { + // Release our grab on the pointer. + gdk_pointer_ungrab(GDK_CURRENT_TIME); + gtk_grab_remove(tab->widget()); + tab->dragging_ = false; // Notify the drag helper that we're done with any potential drag operations. // Clean up the drag helper, which is re-created on the next mouse press. @@ -254,8 +258,11 @@ void TabGtk::DidProcessEvent(GdkEvent* event) { // limbo where the drag is still active, but we don't get any // motion-notify-event signals. Adding the grab back doesn't keep the // drag alive, but it does get us out of this bind by finishing the drag. - if (delegate_->IsTabDetached(this)) + if (delegate_->IsTabDetached(this)) { + gdk_pointer_grab(widget()->window, FALSE, GDK_POINTER_MOTION_HINT_MASK, + NULL, NULL, GDK_CURRENT_TIME); gtk_grab_add(widget()); + } break; default: break; |