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

Unified Diff: chrome/browser/ui/gtk/menu_bar_helper.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/location_bar_view_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/menu_bar_helper.cc
diff --git a/chrome/browser/ui/gtk/menu_bar_helper.cc b/chrome/browser/ui/gtk/menu_bar_helper.cc
index 7a792f830a804157b4cc1adc614b94e574110471..3240577b3eddddee8ce49cf717784f7a4f7c0c3a 100644
--- a/chrome/browser/ui/gtk/menu_bar_helper.cc
+++ b/chrome/browser/ui/gtk/menu_bar_helper.cc
@@ -26,9 +26,12 @@ void PopulateSubmenus(GtkWidget* child, gpointer data) {
// Is the cursor over |menu| or one of its parent menus?
bool MotionIsOverMenu(GtkWidget* menu, GdkEventMotion* motion) {
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(menu, &allocation);
+
if (motion->x >= 0 && motion->y >= 0 &&
- motion->x < menu->allocation.width &&
- motion->y < menu->allocation.height) {
+ motion->x < allocation.width &&
+ motion->y < allocation.height) {
return true;
}
@@ -131,8 +134,10 @@ gboolean MenuBarHelper::OnMenuMotionNotify(GtkWidget* menu,
last_button = button;
- if (x >= 0 && y >= 0 && x < button->allocation.width &&
- y < button->allocation.height) {
+ GtkAllocation allocation;
+ gtk_widget_get_allocation(button, &allocation);
+
+ if (x >= 0 && y >= 0 && x < allocation.width && y < allocation.height) {
if (button != button_showing_menu_)
delegate_->PopupForButton(button);
return TRUE;
« no previous file with comments | « chrome/browser/ui/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/gtk/tabs/dragged_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698