Bug 942913 - Make sheets return YES from isVisibleOrBeingShown while the sheet opening animation runs so that we don't refuse to composite them during the animation. r=smichaud

This commit is contained in:
Markus Stange 2013-11-25 19:00:55 +01:00
parent d1a6a51f41
commit 8d3c70c826
2 changed files with 10 additions and 15 deletions

View File

@ -97,6 +97,7 @@ typedef struct _nsCocoaWindowList {
- (void)updateTrackingArea;
- (NSView*)trackingAreaView;
- (void)setBeingShown:(BOOL)aValue;
- (BOOL)isVisibleOrBeingShown;
- (ChildView*)mainChildView;

View File

@ -35,7 +35,6 @@
#include "gfxPlatform.h"
#include "qcms.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/Preferences.h"
#include <algorithm>
@ -693,6 +692,8 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
if (!mSheetNeedsShow && !bState && ![mWindow isVisible])
return NS_OK;
[mWindow setBeingShown:bState];
nsIWidget* parentWidget = mParent;
nsCOMPtr<nsPIWidgetCocoa> piParentWidget(do_QueryInterface(parentWidget));
NSWindow* nativeParentWindow = (parentWidget) ?
@ -912,6 +913,8 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
if (mPopupContentView)
mPopupContentView->Show(bState);
[mWindow setBeingShown:NO];
return NS_OK;
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
@ -2632,25 +2635,16 @@ static NSMutableSet *gSwizzledFrameViewClasses = nil;
return self;
}
- (void)setBeingShown:(BOOL)aValue
{
mBeingShown = aValue;
}
- (BOOL)isVisibleOrBeingShown
{
return [super isVisible] || mBeingShown;
}
- (void)orderFront:(id)sender
{
AutoRestore<BOOL> saveBeingShown(mBeingShown);
mBeingShown = YES;
[super orderFront:sender];
}
- (void)makeKeyAndOrderFront:(id)sender
{
AutoRestore<BOOL> saveBeingShown(mBeingShown);
mBeingShown = YES;
[super makeKeyAndOrderFront:sender];
}
- (void)dealloc
{
[mActiveTitlebarColor release];