Previously we relied on Foundation.framework being implicitly linked by other frameworks, but this change is required when building with Xcode 12 targeting older macOS versions to fix missing CFNetwork symbols.
We use a manual-reset event rather than an auto-reset event to cancel IO
on the pipe. This avoids unlucky cases where new IO would start just
after signalling the event and would block indefinitely while waiting on
the newly-unsignalled event.
As far as I can tell, if a read was cancelled from a background thread,
the IO operation wasn't cancelled, so the system was poking at the
stack-allocated OVERLAPPED structure after it had been removed from the
stack, at which point something else might be occupying that region of
stack memory.
I'm pretty sure Address Sanitizer should be able to catch this sort of
thing so I'm surprised it didn't complain here.
Previously, calls to `open` blocked when creating a writeable pipe.
This could cause other calls to block indefinitely, waiting for the pipe
to become available.
Now, we open the pipe in nonblocking mode, which allows us to retry
indefinitely, checking `stopReadOperation` each time to find out whether
`close` has been called and allowing a graceful exit.
Also allows optionally ignoring callbacks during disconnect, so that the
call to `connectionLost` can be bypassed when disconnect is called from
the derived class destructor.
Previously we were choosing a Visual and Colormap on initialisation of the X11 Display which could lead to bugs when opening a window with different visual and colour requirements. This commit makes 16, 24 and 32-bit visuals available and chooses the correct one when opening a window.
It was possible to encounter data races when when requesting connection
callbacks on the message thread, but creating/destroying connection
objects on a background thread.
This change ensures that a message will not be processed if the
destination connection is destroyed before the message is delivered.
Deprecated methods returning a Display& in favour of new methods returning a Display* which return nullptr when running on a system with no connected displays.
Adds a new `drawPopupMenuBackgroundForOption` member function to
`PopupMenu::LookAndFeelMethods`. By default this will pass through
to `drawPopupMenuBackground`, but it can be overridden in cases
where the background appearance depends on the current `Options`.