Closed Bug 402627 Opened 16 years ago Closed 16 years ago
"WARNING: Calling Set
Window Titlebar Color on window that isn't of the Toolbar Window class ."
This warning appears when I start Firefox: WARNING: Calling SetWindowTitlebarColor on window that isn't of the ToolbarWindow class.: file /Users/jruderman/trunk/mozilla/widget/src/cocoa/nsCocoaWindow.mm, line 1089 I'm guessing this started happening with the landing of bug 402125.
Can you break on that line and backtrace?
This is caused by someone trying to set the titlebar color of the hidden window. They should probably stop doing that ;)
I think you better fail silently, otherwise we'd have to distinguish the hidden window any anything which might be opened as a sheet using pure css selectors...
If we're the hidden window, we should fail silently according to Mano.
Comment on attachment 287616 [details] [diff] [review] fix v1.0 + // Fail silently for the hidden window. + if (SameCOMIdentity(GetHiddenWindowWidget(), (nsIWidget*)this)) + return NS_ERROR_FAILURE; I'm not sure raising an error here is failing silently, and in any case the comment itself is saying nothing new about obvious code so it isn't necessary. Why return an error instead of NS_OK? I'm not sure which is better, error or NS_OK.
This should be a little clearer.
Comment on attachment 287701 [details] [diff] [review] fix v1.1 + nsIWidget* hiddenWindowWidgetNoCOMPtr = GetHiddenWindowWidget(); return static_cast<nsCocoaWindow*>(hiddenWindowWidgetNoCOMPtr)->GetMenuBar(); If GetHiddenWindowWidget return null this will crash.
Attachment #287701 - Flags: review?(joshmoz) → review-
Comment on attachment 289100 [details] [diff] [review] fix v1.2 >@@ -1521,6 +1533,7 @@ void patternDraw(void* aInfo, CGContextR > CGColorSpaceRelease(colorSpace); > CGFunctionRelease(function); > CGContextDrawShading(aContext, shading); >+ CGShadingRelease(shading); This won't apply and it has nothing to do with this bug.
Attachment #289100 - Flags: review?(joshmoz) → review-
Comment on attachment 289100 [details] [diff] [review] fix v1.2 >+ // Don't output a warning for the hidden window. >+ if (!SameCOMIdentity(GetHiddenWindowWidget(), (nsIWidget*)this)) >+ NS_WARNING("Calling SetWindowTitlebarColor on window that isn't of the ToolbarWindow class."); > return NS_ERROR_FAILURE; > } Since NS_WARNING will only apply in a debug build, I think you should also make the if-statement only run on debug builds by putting it inside #if DEBUG.
Should apply cleanly now that I'm not working from an old source tree. Using NS_WARN_IF_FALSE as well now.
Whiteboard: [not a blocker; needs explicit a+]
Attachment #290286 - Flags: superreview?(roc) → superreview+
Comment on attachment 290286 [details] [diff] [review] fix v1.3 Want this to land for 1.9. It's silencing a spurious warning during start up, and helps make automated testing easier and real warnings stand out better.
Attachment #290286 - Flags: approval1.9?
Attachment #290286 - Flags: approval1.9? → approval1.9+
Checking in widget/src/cocoa/nsCocoaWindow.mm; /cvsroot/mozilla/widget/src/cocoa/nsCocoaWindow.mm,v <-- nsCocoaWindow.mm new revision: 1.120; previous revision: 1.119 done
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.