From 7d14a1010d900f0e83413ea29837ced2bd0e666b Mon Sep 17 00:00:00 2001 From: hogliux Date: Mon, 18 May 2015 13:07:06 +0100 Subject: [PATCH] Fix edge-case where no main display would be found on the raspberry pi --- modules/juce_gui_basics/native/juce_linux_Windowing.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index 07edce4667..e5e1a7e787 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -1198,6 +1198,11 @@ private: if (! screens->outputs[j]) continue; + // Xrandr on the raspberry pi fails to determine the main display (mainDisplay == 0)! + // Detect this edge case and make the first found display the main display + if (! mainDisplay) + mainDisplay = screens->outputs[j]; + ScopedPointer output; if ((output = xrandr.getOutputInfo (dpy, screens.get(), screens->outputs[j])).get())