Bug 562138 - Make all NSWindow's transparent by default, to prevent unwanted flashing of the background window while creating popup windows caused by synchronous painting of NSWindow's; r=josh
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 08 Apr 2011 15:06:15 -0700
changeset 67728 ed6f4884f03dd239a54d2382894275de30e6f832
parent 67727 b980d0cf984767de8eba4a7e82c57195d44bfe60
child 67729 bf3bdd1d967164e068aed53d2ef9135df8d9980b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh
bugs562138
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 562138 - Make all NSWindow's transparent by default, to prevent unwanted flashing of the background window while creating popup windows caused by synchronous painting of NSWindow's; r=josh
widget/src/cocoa/nsCocoaWindow.mm
--- a/widget/src/cocoa/nsCocoaWindow.mm
+++ b/widget/src/cocoa/nsCocoaWindow.mm
@@ -424,17 +424,18 @@ nsresult nsCocoaWindow::CreateNativeWind
 
   if (mWindowType == eWindowType_invisible) {
     [mWindow setLevel:kCGDesktopWindowLevelKey];
   } else if (mWindowType == eWindowType_popup) {
     SetPopupWindowLevel();
     [mWindow setHasShadow:YES];
   }
 
-  [mWindow setBackgroundColor:[NSColor whiteColor]];
+  [mWindow setBackgroundColor:[NSColor clearColor]];
+  [mWindow setOpaque:NO];
   [mWindow setContentMinSize:NSMakeSize(60, 60)];
   [mWindow disableCursorRects];
 
   // setup our notification delegate. Note that setDelegate: does NOT retain.
   mDelegate = [[WindowDelegate alloc] initWithGeckoWindow:this];
   [mWindow setDelegate:mDelegate];
 
   [[WindowDataMap sharedWindowDataMap] ensureDataForWindow:mWindow];