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

Unified Diff: chrome/browser/ui/gtk/tabs/tab_gtk.cc

Issue 8921022: GTK: Even more cleanup to access allocation through the accessor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years 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 | « chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/tabs/tab_gtk.cc
diff --git a/chrome/browser/ui/gtk/tabs/tab_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_gtk.cc
index 7f8f977587f4dca34ce10c5d6fe2dba9adc84ea7..7b0037a2794107bb5eb2cc237d5fd588eb825406 100644
--- a/chrome/browser/ui/gtk/tabs/tab_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_gtk.cc
@@ -157,12 +157,15 @@ gboolean TabGtk::OnButtonReleaseEvent(GtkWidget* widget,
}
}
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(widget, &allocation);
+
// Middle mouse up means close the tab, but only if the mouse is over it
// (like a button).
if (event->button == 2 &&
event->x >= 0 && event->y >= 0 &&
- event->x < widget->allocation.width &&
- event->y < widget->allocation.height) {
+ event->x < allocation.width &&
+ event->y < allocation.height) {
// If the user is currently holding the left mouse button down but hasn't
// moved the mouse yet, a drag hasn't started yet. In that case, clean up
// some state before closing the tab to avoid a crash. Once the drag has
« no previous file with comments | « chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698