Xinerama for multimon support


I run dual-screen X11 on my Gentoo station, and found it a bit annoying for the demo application to pop up split smack between my two screens, so I went ahead and added Xinerama support to the codebase. This makes the multi-mon behaviour in Linux much more similar to that in Windows and OSX. Now the demo application pops up centered on my first monitor rather than split between the two. :slight_smile:

The patch is available at . It was made against my somewhat modified tree, but I tested it against a fresh unzip as well, so the line numbers in the patch may be a bit off but it will still intelligently locate the correct place to patch. Enter the juce directory and type:

bunzip2 -c /path/to/juce_linux_xinerama.patch.bz2 | patch -p1 and then rebuild.

The Xinerama support is enabled at compile time by defining XINERAMA for the gcc preprocessor, which could be useful for those who want to compile without dependencies. If XINERAMA is not defined at compile time, the behaviour defaults to the old way (only exposes one screen to JUCE). If it is defined, the JUCE runtime queries the X server for the Xinerama extension; if available, it queries Xinerama for information about all available monitors, else it falls back to the old behaviour.

This patch could definitely stand some peer-review scrutiny and testing, but it was considerably simpler to implement than the OpenGL patch. Hope someone besides me finds these useful :smiley: