[QGIS Commit] r9145 - trunk/qgis/src/app

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Aug 24 05:06:14 EDT 2008


Author: gjm
Date: 2008-08-24 05:06:14 -0400 (Sun, 24 Aug 2008)
New Revision: 9145

Modified:
   trunk/qgis/src/app/qgisapp.cpp
   trunk/qgis/src/app/qgisapp.h
Log:
Fix for ticket #884 (inconsistent behaviour with fullscreen mode)


Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2008-08-24 08:54:57 UTC (rev 9144)
+++ trunk/qgis/src/app/qgisapp.cpp	2008-08-24 09:06:14 UTC (rev 9145)
@@ -433,6 +433,7 @@
   setAcceptDrops( true );
 
   mFullScreenMode = false;
+  mPrevScreenModeMaximized = false;
   show();
   qApp->processEvents();
   //finally show all the application settings as initialised above
@@ -3305,11 +3306,32 @@
 {
   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;
   }

Modified: trunk/qgis/src/app/qgisapp.h
===================================================================
--- trunk/qgis/src/app/qgisapp.h	2008-08-24 08:54:57 UTC (rev 9144)
+++ trunk/qgis/src/app/qgisapp.h	2008-08-24 09:06:14 UTC (rev 9145)
@@ -698,8 +698,12 @@
     // 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;
 



More information about the QGIS-commit mailing list