As well as fixing some inconsistent behaviour, the main purpose of this
is to make sure either exec() or exit() is always called on a fork()-ed
child process. With custom launch commands, it's now possible to cause
exec() to fail, which was resulting in the child process just falling
through and continuing alongside the parent process - which usually ends
up causing the whole program to crash.
That commit introduced an issue (e.g. #115) where the internal '/close'
API would always be interpreted as coming from the primary browser due
to how the ROUTE macro expands. I blame C++ for not warning me.
Some archive formats do this and some don't. They do it to try to be
helpful, but it's more annoying than helpful for those of us who want to
support lots of archive formats, because it makes the output of
libarchive less standardised.
This is required by the plugin loader, and is usually handled by the
frontend but we don't get the path from the frontend in this specific
case, so we need to append one ourselves. We also need to make sure the
path uses '/' as separators, but as far as I can tell, C++'s "path" type
will always give us that as long as we don't call "make_preferred".
Instead of heap-allocating and sending all the data in one chunk, do
multiple sends with a mutex preventing any interleaving. Potentially
slightly faster, and fixes a plethora of bugs.
window.close() is completely broken in CEF, it destroys the browser and
calls OnBeforeClose before calling CanClose, which generally leads to
segmentation faults no matter how you handle it. So don't use it. Close
via the Bolt API instead.
Also implicitly fixes a bug where OnPaint assumed the type to be
PET_VIEW, which led to visual corruption and occasional crashing when
using a drop-down menu.