From: rnv Date: Thu, 14 Sep 2017 11:02:28 +0000 (+0300) Subject: Fix for '23472: [CEA 2164] Display problem when ParaView isn't the first viewer'... X-Git-Tag: V8_4_0a2~2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=642a1c6e73784a1a782c769837be3b3a3ee431d9;p=modules%2Fgui.git Fix for '23472: [CEA 2164] Display problem when ParaView isn't the first viewer' issue. --- diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index d61892187..ddaae388f 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -111,7 +110,9 @@ void PVViewer_Behaviors::instanciateAllBehaviors(QMainWindow * desk) new pqAutoLoadPluginXMLBehavior(this); // auto load plugins GUI stuff new pqPluginDockWidgetsBehavior(desk); new pqPluginActionGroupBehavior(desk); - new pqPersistentMainWindowStateBehavior(desk); + // rnv: Disable ParaView main window persistance mechanism, + // because SALOME has own functionality for store/restore windows state. + // new pqPersistentMainWindowStateBehavior(desk); new pqObjectPickingBehavior(desk); new pqCollaborationBehavior(this); new pqViewStreamingBehavior(this); diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index ea144e9a9..c39d700e0 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -371,12 +371,36 @@ int main( int argc, char **argv ) } #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) - // initialization of the X11 visual on Linux - QSurfaceFormat format; - format.setDepthBufferSize(16); - format.setStencilBufferSize(1); - format.setProfile(QSurfaceFormat::CompatibilityProfile); - QSurfaceFormat::setDefaultFormat(format); + + // RNV: setup the default format: + // QSurfaceFormat should be set before creation of QApplication, + // so to avoid conflicts beetween SALOME and ParaView QSurfaceFormats we should merge theirs formats + // (see comments below) and set the resultant format here. + + // Settings from Paraview: + // This piece of code was taken from QVTKOpenGLWidget::defaultFormat() method in + // order to avoid dependency of the SALOME_Session_Server on vtk libraries + QSurfaceFormat fmt; + fmt.setRenderableType(QSurfaceFormat::OpenGL); + fmt.setVersion(3, 2); + fmt.setProfile(QSurfaceFormat::CoreProfile); + fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer); + fmt.setRedBufferSize(1); + fmt.setGreenBufferSize(1); + fmt.setBlueBufferSize(1); + fmt.setDepthBufferSize(1); + fmt.setStencilBufferSize(0); + fmt.setAlphaBufferSize(1); + fmt.setStereo(false); + fmt.setSamples(0); + + // Settings for OCCT viewer window: + fmt.setDepthBufferSize(16); + fmt.setStencilBufferSize(1); + // fmt.setProfile(QSurfaceFormat::CompatibilityProfile); + + QSurfaceFormat::setDefaultFormat(fmt); + #endif // Create Qt application instance;