Bug 512575 - Switching out of fullscreen mode and alt-tabbing puts me back in fullscreen mode. r=dholbert

This commit is contained in:
Doug Turner 2009-08-26 17:09:47 -07:00
parent 4a0d6558b5
commit 10fd01fde6
2 changed files with 15 additions and 1 deletions

View File

@ -383,6 +383,8 @@ nsWindow::nsWindow()
mTransientParent = nsnull;
mWindowType = eWindowType_child;
mSizeState = nsSizeMode_Normal;
mLastSizeMode = nsSizeMode_Normal;
#ifdef MOZ_X11
mOldFocusWindow = 0;
#endif /* MOZ_X11 */
@ -5001,11 +5003,19 @@ nsWindow::MakeFullScreen(PRBool aFullScreen)
#if GTK_CHECK_VERSION(2,2,0)
if (aFullScreen) {
if (mSizeMode != nsSizeMode_Fullscreen)
mLastSizeMode = mSizeMode;
mSizeMode = nsSizeMode_Fullscreen;
gdk_window_fullscreen (mShell->window);
}
else
else {
mSizeMode = mLastSizeMode;
gdk_window_unfullscreen (mShell->window);
}
NS_ASSERTION(mLastSizeMode != nsSizeMode_Fullscreen,
"mLastSizeMode should never be fullscreen");
return NS_OK;
#else
return nsBaseWidget::MakeFullScreen(aFullScreen);

View File

@ -530,6 +530,10 @@ private:
nsCOMPtr<nsITimer> mDragLeaveTimer;
float mLastMotionPressure;
// Remember the last sizemode so that we can restore it when
// leaving fullscreen
nsSizeMode mLastSizeMode;
static PRBool sIsDraggingOutOf;
// drag in progress
static PRBool DragInProgress(void);