summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-19 13:59:16 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-04-26 16:15:34 +0200
commit6839b7714b80cf28614dcd793edcdeb70dc6ed5f (patch)
tree64e09634bcb1bd44febd414223c38d9ff3cf9146 /desktop
parentea33797be1b683ca5743a00bd3347d0806bd62a8 (diff)
tdf#95843: Wait for fire_glxtest_process also in --headless mode
Discussed with mmeeks on IRC that fire_glxtest_process is probably called as early as possible so that its reuslt is ready by the time it is needed in the non-headless case. So best fix for headless is probably to just wait for the sub-process at an opportune point, instead of redesigning the whole mess so that fire_glxtest_process would only be called once its result is actually needed. Change-Id: I4ea9c9d54b83c9695a3b72317e68fed0c410da0e Reviewed-on: https://gerrit.libreoffice.org/53154 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 4bacf58f4af44ac8c4632b43289ccfcc07e5820c) Reviewed-on: https://gerrit.libreoffice.org/53170 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/inc/app.hxx1
-rw-r--r--desktop/source/app/app.cxx9
-rw-r--r--desktop/source/app/sofficemain.cxx4
3 files changed, 14 insertions, 0 deletions
diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 0e5f8774d3c3..d0ef2a66818a 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -181,6 +181,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 192793ea42f1..583ea189165f 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1595,6 +1595,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 657614962489..67c1efe4a799 100644
--- a/desktop/source/app/sofficemain.cxx
+++ b/desktop/source/app/sofficemain.cxx
@@ -122,6 +122,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");