Bug 544242 - implement sizemode_fullscreen on qt. r=stuart

This commit is contained in:
Doug Turner 2010-02-04 06:43:52 -08:00
parent 635a29b33d
commit f8474963f9
2 changed files with 35 additions and 7 deletions

View File

@ -482,14 +482,13 @@ nsWindow::SetSizeMode(PRInt32 aMode)
case nsSizeMode_Minimized:
mWidget->showMinimized();
break;
case nsSizeMode_Fullscreen:
mWidget->showFullScreen();
break;
default:
// nsSizeMode_Normal, really.
mWidget->showNormal ();
// KILLME
//if (mSizeState == nsSizeMode_Minimized)
// gtk_window_deiconify(GTK_WINDOW(mWidget));
//else if (mSizeState == nsSizeMode_Maximized)
// gtk_window_unmaximize(GTK_WINDOW(mWidget));
mWidget->showNormal();
break;
}
@ -1832,7 +1831,32 @@ void nsWindow::QWidgetDestroyed()
NS_IMETHODIMP
nsWindow::MakeFullScreen(PRBool aFullScreen)
{
return nsBaseWidget::MakeFullScreen(aFullScreen);
if (aFullScreen) {
if (mSizeMode != nsSizeMode_Fullscreen)
mLastSizeMode = mSizeMode;
mSizeMode = nsSizeMode_Fullscreen;
mWidget->showFullScreen();
}
else {
mSizeMode = mLastSizeMode;
switch (mSizeMode) {
case nsSizeMode_Maximized:
mWidget->showMaximized();
break;
case nsSizeMode_Minimized:
mWidget->showMinimized();
break;
case nsSizeMode_Normal:
mWidget->showNormal();
break;
}
}
NS_ASSERTION(mLastSizeMode != nsSizeMode_Fullscreen,
"mLastSizeMode should never be fullscreen");
return NS_OK;
}
NS_IMETHODIMP

View File

@ -230,6 +230,10 @@ protected:
// shouldn't be automatically set to 0,0 for first show.
PRBool mPlaced;
// Remember the last sizemode so that we can restore it when
// leaving fullscreen
nsSizeMode mLastSizeMode;
/**
* Event handlers (proxied from the actual qwidget).
* They follow normal Qt widget semantics.