Skip to content

Commit cc19e96

Browse files
author
gjm
committed
Fix for ticket #884 (inconsistent behaviour with fullscreen mode)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9145 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 48c67fd commit cc19e96

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/app/qgisapp.cpp

+23-1
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ QgisApp::QgisApp( QSplashScreen *splash, QWidget * parent, Qt::WFlags fl )
433433
setAcceptDrops( true );
434434

435435
mFullScreenMode = false;
436+
mPrevScreenModeMaximized = false;
436437
show();
437438
qApp->processEvents();
438439
//finally show all the application settings as initialised above
@@ -3305,11 +3306,32 @@ void QgisApp::toggleFullScreen()
33053306
{
33063307
if ( true == mFullScreenMode )
33073308
{
3308-
showNormal();
3309+
if ( true == mPrevScreenModeMaximized )
3310+
{
3311+
// Change to maximized state. Just calling showMaximized() results in
3312+
// the window going to the normal state. Calling showNormal() then
3313+
// showMaxmized() is a work-around. Turn off rendering for this as it
3314+
// would otherwise cause two re-renders of the map, which can take a
3315+
// long time.
3316+
bool renderFlag = getMapCanvas()->renderFlag();
3317+
getMapCanvas()->setRenderFlag(false);
3318+
showNormal();
3319+
showMaximized();
3320+
getMapCanvas()->setRenderFlag(renderFlag);
3321+
mPrevScreenModeMaximized = false;
3322+
}
3323+
else
3324+
{
3325+
showNormal();
3326+
}
33093327
mFullScreenMode = false;
33103328
}
33113329
else
33123330
{
3331+
if ( isMaximized() )
3332+
{
3333+
mPrevScreenModeMaximized = true;
3334+
}
33133335
showFullScreen();
33143336
mFullScreenMode = true;
33153337
}

src/app/qgisapp.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,12 @@ class QgisApp : public QMainWindow
698698
// Flag to indicate if maptips are on or off
699699
bool mMapTipsVisible;
700700

701-
//!flag to indicat wehter we are in fullscreen mode or not
701+
//!flag to indicate whether we are in fullscreen mode or not
702702
bool mFullScreenMode;
703+
704+
//!flag to indicate that the previous screen mode was 'maximised'
705+
bool mPrevScreenModeMaximized;
706+
703707
QgsPythonDialog* mPythonConsole;
704708
QgsPythonUtils* mPythonUtils;
705709

0 commit comments

Comments
 (0)