Skip to content

Commit

Permalink
Fix for ticket #884 (inconsistent behaviour with fullscreen mode)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9145 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gjm committed Aug 24, 2008
1 parent 0eed8db commit 8449c22
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
24 changes: 23 additions & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ QgisApp::QgisApp( QSplashScreen *splash, QWidget * parent, Qt::WFlags fl )
setAcceptDrops( true );

mFullScreenMode = false;
mPrevScreenModeMaximized = false;
show();
qApp->processEvents();
//finally show all the application settings as initialised above
Expand Down Expand Up @@ -3305,11 +3306,32 @@ void QgisApp::toggleFullScreen()
{
if ( true == mFullScreenMode )
{
showNormal();
if ( true == mPrevScreenModeMaximized )
{
// Change to maximized state. Just calling showMaximized() results in
// the window going to the normal state. Calling showNormal() then
// showMaxmized() is a work-around. Turn off rendering for this as it
// would otherwise cause two re-renders of the map, which can take a
// long time.
bool renderFlag = getMapCanvas()->renderFlag();
getMapCanvas()->setRenderFlag(false);
showNormal();
showMaximized();
getMapCanvas()->setRenderFlag(renderFlag);
mPrevScreenModeMaximized = false;
}
else
{
showNormal();
}
mFullScreenMode = false;
}
else
{
if ( isMaximized() )
{
mPrevScreenModeMaximized = true;
}
showFullScreen();
mFullScreenMode = true;
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -698,8 +698,12 @@ class QgisApp : public QMainWindow
// Flag to indicate if maptips are on or off
bool mMapTipsVisible;

//!flag to indicat wehter we are in fullscreen mode or not
//!flag to indicate whether we are in fullscreen mode or not
bool mFullScreenMode;

//!flag to indicate that the previous screen mode was 'maximised'
bool mPrevScreenModeMaximized;

QgsPythonDialog* mPythonConsole;
QgsPythonUtils* mPythonUtils;

Expand Down

0 comments on commit 8449c22

Please sign in to comment.