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

Unified Diff: chrome/browser/gtk/menu_gtk.cc

Issue 408017: GTK: Fix popup menu positioning.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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/menu_gtk.cc
===================================================================
--- chrome/browser/gtk/menu_gtk.cc (revision 32394)
+++ chrome/browser/gtk/menu_gtk.cc (working copy)
@@ -322,6 +322,14 @@
gfx::Point* point = reinterpret_cast<gfx::Point*>(userdata);
*x = point->x();
*y = point->y();
+
+ GtkRequisition menu_req;
+ gtk_widget_size_request(GTK_WIDGET(menu), &menu_req);
+ GdkScreen* screen = gdk_screen_get_default();
Evan Martin 2009/11/19 00:40:32 Isn't this wrong if the menu's on a different scre
Evan Stade 2009/11/19 00:46:18 oh, like a dual monitor setup? didn't think about
+ gint screen_height = gdk_screen_get_height(screen);
+
+ if (*y + menu_req.height > screen_height)
+ *y -= menu_req.height;
}
void MenuGtk::UpdateMenu() {
« 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