The significant change here is that the XSaveContext call in the OpenGL
NativeContext now has a matching XDeleteContext call. This breaks the
connection between the X window and the ComponentPeer, so that we avoid
dereferencing a dangling ComponentPeer pointer if the window receives
events after the peer is destroyed.
This change fixes an issue where opening multiple OpenGLContexts on
certain versions of macOS (observed on 10.13) could cause a deadlock.
The issue can be reproduced by:
- Attaching an OpenGL context to the AudioPluginDemo editor
- Opening multiple copies of the editor simultaneously in a plugin host.
I tested with Live 10.
I also observed the issue in a standalone app that opened new windows
containing OpenGLContexts on a timer.
- 4.1 and 4.3 contexts can now be requested
- The requested context version is no longer ignored on Linux
- Debugging contexts are now enabled in Debug builds with GL 4.3
- Fixes a bug where glEnable(GL_TEXTURE_2D) was called in core profiles
On Linux, repaints are only issued if the number of received SHM
completion events matches the number of events initiated with
`xShmPutImage`.
Previously, destroying a GL context was calling `XSync (display, True)`
which cleared the event queue. Sometimes, this would cause an 'SHM
Completion Event' to be removed from the queue. This meant that the
number of received events would never match the number of initiated
events, and repainting would stop indefinitely.
By calling `XSync (display, False)` instead, we ensure that pending
events are kept in the queue, so any pending SHM completion event will
be found as usual during the next repaint timer callback.
MIDI: Several ALSA Seq improvements
===================================
Many things were done in this patch (I couldn't really split in several
patches):
* Only one ALSA Sequencer client per application
* ALSA Sequencer client name is the application's name by default
* Fixed a bug when getDeivces() would return devices created by the
application itself
* Only ports created with createNewDevice() are allowed to be subscribed,
other ports (created by openDevice()) doesn't allow subscription
* AlsaPort is now handled by AlsaClient, basically having the proper
representation such as the ALSA Sequencer has.
Files: Fix default directory paths
==================================
Some information on:
* Linux LSB FHS:
http://www.linuxfoundation.org/collaborate/workgroups/lsb/fhs-30
* https://wiki.archlinux.org/index.php/Xdg_user_directories
Refactor Event loop to remove X11 dependency
============================================
The goal of this refactor was to remove X11 dependencies on juce_events
to enable non-gui applications (example, Embedded Linux apps) to have no
libx11 dependency.
The side-effect of this refactor is easy implementation of other Linux
graphical back-end, cleanup some code, better handling of X displays and
other benefits.
I removed a lot of the code from juce_linux_Windowing to separate files
for clarity. I also renamed all Linux X11 files to *linux_X11* instead of
just *linux*.
X11: Remove unnecessary XGrabButton call
========================================
This call is made unnecessary if used proper window flags when a window
is created.
Linux now compiles (clang++-3.5) without warnings when the following is enabled (these flags are identical to equator mac warnings):
-Wreorder -Wconstant-conversion -Wint-conversion -Woverloaded-virtual -Wuninitialized -Wunused-parameter -Wshorten-64-to-32 -Wstrict-aliasing -Wshadow -Wconversion -Wsign-compare -Werror -Wsign-conversion