X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSession%2FSALOME_Session_Server.cxx;h=4812cf6fb6a8494eb55c893ab3c9ee43a7a9f919;hb=aa1f2c1b55f6502a1995cf373e34e1a5741b9b3a;hp=fc1db2ac19c6f2ffec16236060e272254b92857b;hpb=8d7c6f2eb4937428e0145ea1dbea48c99f907856;p=modules%2Fgui.git diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index fc1db2ac1..4812cf6fb 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -20,9 +20,9 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include #include // this include must be the first one as it includes Python.h #include -#include #include #include #include @@ -33,6 +33,7 @@ #include #include #include +#include "KernelBasis.hxx" #include "Session_Session_i.hxx" #include "Session_ServerCheck.hxx" @@ -76,6 +77,18 @@ #include #include +#ifdef WIN32 +extern "C" { +// For DWORD (see end of file) +#include "windef.h" +// Force high-performance graphics on dual-GPU systems + // http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf + __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; + // https://community.amd.com/thread/169965 + __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; +} +#endif + //! CORBA server for SALOME GUI session /*! * SALOME_Session_Server launches a SALOME session servant. @@ -383,6 +396,7 @@ int AbstractGUIAppMain(int argc, char **argv); class GUIAppOldStyle { public: + static constexpr bool SSL_MODE = false; using NamingServiceImplementation = OldStyleNS; void connectToNSIfNeeded(CORBA::ORB_ptr orb) { _NS.reset(new SALOME_NamingService(orb)); } void shutdownCORBAStufIfNeeded(bool shutdownAll, CORBA::ORB_ptr orb); @@ -396,6 +410,7 @@ private: class GUIAppNewStyle { public: + static constexpr bool SSL_MODE = true; using NamingServiceImplementation = NewStyleNS; void connectToNSIfNeeded(CORBA::ORB_ptr orb) { /*! nothing */ } void shutdownCORBAStufIfNeeded(bool shutdownAll, CORBA::ORB_ptr orb) { /*! nothing */ } @@ -451,6 +466,8 @@ template int AbstractGUIAppMain(int argc, char **argv) { using NamingServiceImplementation = typename GUI_APP_STYLE::NamingServiceImplementation; + setSSLMode(GUI_APP_STYLE::SSL_MODE); + setGUIMode(true); GUI_APP_STYLE self; // Set-up application settings configuration (as for QSettings) // Note: these are default settings which can be customized (see below) @@ -478,6 +495,7 @@ int AbstractGUIAppMain(int argc, char **argv) // Create Qt application instance: this should be done as early as possible! // Note: QApplication forces setting locale LC_ALL to system one: setlocale(LC_ALL, ""). + SetArgcArgv(argc,argv); Application app(argc, argv); // Initialize Python (only once) @@ -562,15 +580,14 @@ int AbstractGUIAppMain(int argc, char **argv) try { // ...create ORB, get RootPOA object, NamingService, etc. - ORB_INIT &init = *SINGLETON_::Instance(); - ASSERT(SINGLETON_::IsAlreadyExisting()); int orbArgc = 1; if (std::string(argv[1]).find("-ORBInitRef") != std::string::npos) { orbArgc = 3; remoteLauncher = true; } - orb = init(orbArgc, argv); + SetArgcArgv(orbArgc, argv); + orb = KERNEL::GetRefToORB(); CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); poa = PortableServer::POA::_narrow(obj);