]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Passing X display and visual suitable for 3D visualization to QApplication constructo...
authorsan <san@opencascade.com>
Mon, 12 Apr 2010 13:44:24 +0000 (13:44 +0000)
committersan <san@opencascade.com>
Mon, 12 Apr 2010 13:44:24 +0000 (13:44 +0000)
src/Session/SALOME_Session_Server.cxx

index 5d42b4661b7d4f039e92bdca930500565b3c35c3..e2d7979a6b75a3e409d14edfe1a8e677a7339d88 100755 (executable)
@@ -58,6 +58,7 @@
 #include "Session_ServerLauncher.hxx"
 #include "Session_ServerCheck.hxx"
 
+#include <Qtx.h>
 #include <QtxSplash.h>
 #include <Style_Salome.h>
 #include <SUIT_Tools.h>
@@ -257,7 +258,15 @@ public:
 #ifdef ENABLE_TESTRECORDER
   SALOME_QApplication( int& argc, char** argv ) : TestApplication( argc, argv ), myHandler ( 0 ) {}
 #else
-  SALOME_QApplication( int& argc, char** argv ) : QApplication( argc, argv ), myHandler ( 0 ) {}
+  SALOME_QApplication( int& argc, char** argv )
+#ifndef WIN32
+  // san: Opening an X display and choosing a visual most suitable for 3D visualization
+  // in order to make SALOME viewers work with non-native X servers
+  : QApplication( (Display*)Qtx::getDisplay(), argc, argv, Qtx::getVisual() ),
+#else
+  : QApplication( argc, argv ), 
+#endif
+    myHandler ( 0 ) {}
 #endif
 
   virtual bool notify( QObject* receiver, QEvent* e )