From: IOhannes m zmölnig Date: Mon, 16 Mar 2020 12:07:13 +0000 (+0100) Subject: Add patch to not fail fatally without X-server X-Git-Tag: archive/raspbian/5.4.7_ds0-2+rpi1^2~17 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3b9b48200afc4b7531709fc79058dd11a6d998e8;p=juce.git Add patch to not fail fatally without X-server --- diff --git a/debian/patches/0011-Don-t-fail-fatally-if-gui-cannot-connect-to-X-server.patch b/debian/patches/0011-Don-t-fail-fatally-if-gui-cannot-connect-to-X-server.patch new file mode 100644 index 00000000..2dadeccf --- /dev/null +++ b/debian/patches/0011-Don-t-fail-fatally-if-gui-cannot-connect-to-X-server.patch @@ -0,0 +1,49 @@ +From: kunitoki +Date: Mon, 16 Mar 2020 13:01:47 +0100 +Subject: Don't fail fatally if gui cannot connect to X server +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Bug: https://github.com/WeAreROLI/JUCE/issues/422 + +This is a slight modification of https://github.com/WeAreROLI/JUCE/issues/422 by +IOhannes m zmölnig, using early exits rather than longish if-clauses (mainly to +minimize the diff). +--- + modules/juce_gui_basics/native/juce_linux_X11.cpp | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/modules/juce_gui_basics/native/juce_linux_X11.cpp b/modules/juce_gui_basics/native/juce_linux_X11.cpp +index a2ceb67..7d67541 100644 +--- a/modules/juce_gui_basics/native/juce_linux_X11.cpp ++++ b/modules/juce_gui_basics/native/juce_linux_X11.cpp +@@ -149,7 +149,8 @@ XWindowSystem::~XWindowSystem() noexcept + + ::Display* XWindowSystem::displayUnref() noexcept + { +- jassert (display != nullptr); ++ if (!display) ++ return display; + jassert (displayCount.get() > 0); + + if (--displayCount == 0) +@@ -168,7 +169,7 @@ void XWindowSystem::initialiseXDisplay() noexcept + if (display == nullptr) + { + Logger::outputDebugString ("Failed to connect to the X Server."); +- Process::terminate(); ++ return; + } + + // Create a context to store user data associated with Windows we create +@@ -223,6 +224,9 @@ void XWindowSystem::initialiseXDisplay() noexcept + + void XWindowSystem::destroyXDisplay() noexcept + { ++ if (!display) ++ return; ++ + ScopedXLock xlock (display); + XDestroyWindow (display, juce_messageWindowHandle); + juce_messageWindowHandle = 0; diff --git a/debian/patches/series b/debian/patches/series index a5cbb7a7..3110dd7a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,3 +8,4 @@ debian_python3.patch debian_unittests_globalpaths.patch debian_vst.patch debian_link_systemlibs.patch +0011-Don-t-fail-fatally-if-gui-cannot-connect-to-X-server.patch