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

Unified Diff: ui/base/cocoa/underlay_opengl_hosting_window.mm

Issue 10003005: Zero-sized windows are bad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: formatting Created 8 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 | « chrome/browser/ui/cocoa/status_bubble_mac.mm ('k') | ui/base/cocoa/window_size_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/underlay_opengl_hosting_window.mm
diff --git a/ui/base/cocoa/underlay_opengl_hosting_window.mm b/ui/base/cocoa/underlay_opengl_hosting_window.mm
index 6ed0624a6a3652537d10205c4d4b5240d1c53604..b82decd98d7e9b238c680e1317e24c51a08b038e 100644
--- a/ui/base/cocoa/underlay_opengl_hosting_window.mm
+++ b/ui/base/cocoa/underlay_opengl_hosting_window.mm
@@ -87,6 +87,20 @@ void RootDidAddSubview(id self, SEL _cmd, NSView* subview) {
styleMask:(NSUInteger)windowStyle
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)deferCreation {
+ // It is invalid to create windows with zero width or height. It screws things
+ // up royally:
+ // - It causes console spew: <http://crbug.com/78973>
+ // - It breaks Expose: <http://sourceforge.net/projects/heat-meteo/forums/forum/268087/topic/4582610>
+ //
+ // This is a banned practice
+ // <http://www.chromium.org/developers/coding-style/cocoa-dos-and-donts>. Do
+ // not do this. Use kWindowSizeDeterminedLater in
+ // ui/base/cocoa/window_size_constants.h instead.
+ //
+ // (This is checked here because UnderlayOpenGLHostingWindow is the base of
+ // most Chromium windows, not because this is related to its functionality.)
+ DCHECK(contentRect.size.width > 0 &&
+ contentRect.size.height > 0);
if ((self = [super initWithContentRect:contentRect
styleMask:windowStyle
backing:bufferingType
« no previous file with comments | « chrome/browser/ui/cocoa/status_bubble_mac.mm ('k') | ui/base/cocoa/window_size_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698