Backed out changeset b52fa2372a3a, bug 429954 because of test_popup_preventdefault_chrome.xul orange.

--HG--
extra : rebase_source : 724563157551de21855c99e3e1ed536100d0ec24
This commit is contained in:
Markus Stange 2009-08-13 11:39:40 +12:00
Родитель b922c1e0a2
Коммит f6eb4092ba
2 изменённых файлов: 6 добавлений и 19 удалений

Просмотреть файл

@ -103,7 +103,6 @@ typedef struct _nsCocoaWindowList {
// NS_DEACTIVATE to Gecko for toplevel widgets. Starts out
// PR_FALSE.
PRBool mToplevelActiveState;
BOOL mHasEverBeenZoomed;
}
+ (void)paintMenubarForWindow:(NSWindow*)aWindow;
- (id)initWithGeckoWindow:(nsCocoaWindow*)geckoWind;
@ -239,7 +238,8 @@ public:
virtual void SetShowsToolbarButton(PRBool aShow);
NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, PRBool aActive);
void DispatchSizeModeEvent();
// dispatch an NS_SIZEMODE event on miniaturize or deminiaturize
void DispatchSizeModeEvent(nsSizeMode aSizeMode);
virtual gfxASurface* GetThebesSurface();

Просмотреть файл

@ -1272,11 +1272,10 @@ nsCocoaWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus)
}
void
nsCocoaWindow::DispatchSizeModeEvent()
nsCocoaWindow::DispatchSizeModeEvent(nsSizeMode aSizeMode)
{
nsSizeModeEvent event(PR_TRUE, NS_SIZEMODE, this);
event.mSizeMode = [mWindow isMiniaturized] ? nsSizeMode_Minimized :
[mWindow isZoomed] ? nsSizeMode_Maximized : nsSizeMode_Normal;
event.mSizeMode = aSizeMode;
event.time = PR_IntervalNow();
nsEventStatus status = nsEventStatus_eIgnore;
@ -1584,7 +1583,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
[super init];
mGeckoWindow = geckoWind;
mToplevelActiveState = PR_FALSE;
mHasEverBeenZoomed = PR_FALSE;
return self;
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
@ -1602,8 +1600,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
if (!mGeckoWindow || mGeckoWindow->IsResizing())
return;
// Resizing might have changed our zoom state.
mGeckoWindow->DispatchSizeModeEvent();
mGeckoWindow->ReportSizeEvent();
}
@ -1704,22 +1700,13 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
- (void)windowDidMiniaturize:(NSNotification *)aNotification
{
if (mGeckoWindow)
mGeckoWindow->DispatchSizeModeEvent();
mGeckoWindow->DispatchSizeModeEvent(nsSizeMode_Minimized);
}
- (void)windowDidDeminiaturize:(NSNotification *)aNotification
{
if (mGeckoWindow)
mGeckoWindow->DispatchSizeModeEvent();
}
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)proposedFrame
{
if (!mHasEverBeenZoomed && [window isZoomed])
return NO; // See bug 429954.
mHasEverBeenZoomed = YES;
return YES;
mGeckoWindow->DispatchSizeModeEvent(nsSizeMode_Normal);
}
- (void)sendFocusEvent:(PRUint32)eventType