Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6458)

Unified Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 100116: Fix the case where a previous tab is closing and the mouse is pressed on a ta... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_strip_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_strip_gtk.cc (revision 14743)
+++ chrome/browser/gtk/tabs/tab_strip_gtk.cc (working copy)
@@ -1179,11 +1179,17 @@
// static
gboolean TabStripGtk::OnMousePress(GtkWidget* widget, GdkEventButton* event,
TabStripGtk* tabstrip) {
+ gfx::Point point(event->x, event->y);
+
// Nothing happens on mouse press for middle and right click.
if (event->button != 1)
return TRUE;
- gfx::Point point(event->x, event->y);
+ // The hover index is stale if we're in the middle of an animation and the
+ // mouse is pressed without any movement.
+ if (tabstrip->active_animation_.get())
+ tabstrip->hover_index_ = tabstrip->FindTabHoverIndexIterative(point);
+
if (tabstrip->hover_index_ == -1) {
if (tabstrip->newtab_button_.get()->IsPointInBounds(point) &&
tabstrip->newtab_button_.get()->OnMousePress())
@@ -1193,6 +1199,11 @@
}
TabGtk* tab = tabstrip->GetTabAt(tabstrip->hover_index_);
+
+ // If a previous tab is closing, the hover index does not match the model
+ // index.
+ tabstrip->hover_index_ = tabstrip->GetIndexOfTab(tab);
+
if (tab->OnMousePress(point)) {
gtk_widget_queue_draw(tabstrip->tabstrip_.get());
} else if (tabstrip->hover_index_ != tabstrip->model()->selected_index() &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698