diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/inc/app.hxx | 1 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 9 | ||||
-rw-r--r-- | desktop/source/app/sofficemain.cxx | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index 672229683144..01224c68ffeb 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -183,6 +183,7 @@ OUString ReplaceStringHookProc(const OUString& rStr); #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined LIBO_HEADLESS bool fire_glxtest_process(); +void reap_glxtest_process(); #endif #endif // INCLUDED_DESKTOP_INC_APP_HXX diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index e452529fbac3..e13263d9b51d 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1587,6 +1587,15 @@ int Desktop::Main() CheckOpenCLCompute(xDesktop); #endif + // In headless mode, reap the process started by fire_glxtest_process() early in soffice_main + // (desktop/source/app/sofficemain.cxx), in a code block that needs to be covered by the same + // #if condition as this code block: +#if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL + if (rCmdLineArgs.IsHeadless()) { + reap_glxtest_process(); + } +#endif + // Release solar mutex just before we wait for our client to connect { SolarMutexReleaser aReleaser; diff --git a/desktop/source/app/sofficemain.cxx b/desktop/source/app/sofficemain.cxx index e27b48d8b93a..4fb84d39d2d1 100644 --- a/desktop/source/app/sofficemain.cxx +++ b/desktop/source/app/sofficemain.cxx @@ -125,6 +125,10 @@ extern "C" int DESKTOP_DLLPUBLIC soffice_main() #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && !defined(LIBO_HEADLESS) && HAVE_FEATURE_OPENGL /* Run test for OpenGL support in own process to avoid crash with broken * OpenGL drivers. Start process as early as possible. + * In non-headless mode, the process will be reaped in X11OpenGLDeviceInfo::GetData + * (vcl/opengl/x11/X11DeviceInfo.cxx). In headless mode, the process will be reaped late in + * Desktop::Main (desktop/source/app/app.cxx), in a code block that needs to be covered by the + * same #if condition as this code block. */ bool bSuccess = fire_glxtest_process(); SAL_WARN_IF(!bSuccess, "desktop.opengl", "problems with glxtest"); |