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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 126171: Limit the size of popup menus on linux.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 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/renderer_host/render_widget_host_view_gtk.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_gtk.cc (revision 18411)
+++ chrome/browser/renderer_host/render_widget_host_view_gtk.cc (working copy)
@@ -24,6 +24,9 @@
#include "webkit/api/public/gtk/WebInputEventFactory.h"
#include "webkit/glue/webcursor_gtk_data.h"
+static const int kMaxPopupWidth = 2000;
+static const int kMaxPopupHeight = 2000;
+
using WebKit::WebInputEventFactory;
// This class is a simple convenience wrapper for Gtk functions. It has only
@@ -274,7 +277,9 @@
parent_host_view->Blur();
}
- gtk_widget_set_size_request(view_.get(), pos.width(), pos.height());
+ gtk_widget_set_size_request(view_.get(),
+ std::min(pos.width(), kMaxPopupWidth),
+ std::min(pos.height(), kMaxPopupHeight));
gtk_window_set_default_size(GTK_WINDOW(popup), -1, -1);
// Don't allow the window to be resized. This also forces the window to
« 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