Closes#91
There's some details to still figure out, which are in new issues:
- #109: When opening a window, no handle is returned that gives access to the
window from the opener. Technically this can all be wired up manually,
with exception of requeesting the window close.
- #107: How can a window close itself? Once we have a handle type, we still
need a mechanism to allow a button on a window request that the window
closes gracefully. The examples that currently close the window
call exit instad.
This sounds like a regression, but it was masking a "race condition".
DynamicGuard runs the change callbacks on drop in a background thread.
Validations was using the guard to not have to lock twice.
This led to an issue where the invalid count might be non-zero due to
the callbacks not being invoked, preventing the closure from being
invoked even though there are no validation errors.
Introducing compare_swap gives a higher-level API for Validations to
use, and it also ensures the callbacks are able to be run in the current
thread.
The Container code was causing small rounding errors when laying out
that would cause the layout to sometimes me larger by a pixel. I
searched for all locations we are applying padding and added rounding
calls.
Refs #92
This adds upon the work in #94 by allowing the dynamic's value to be set
and it cause the window size to change.
I've ordered the resizing operations so that changes to the property are
prioritized over automatic adjustments. This doesn't change the behavior
for automatic adjustments in any way.
Closes#97
There was a potential race condition described in #97 that I realized I
had seen occasionally when interacting with an element that was
currently being animated. These were in complex situations, so I thought
I had a situation that could have legitimately caused the warning.
However, this warning is preventing a very specific coding "error", and
that program did not have it. The existing implementation would
potentially prevent one thread's change from invoking its callbacks
because another thread was already executing its callbacks.
This change moves that state into a Mutex/Condvar pair that allows
detecting reentry while allowing other threads to block until its their
turn. When it becomes their turn, they can check whether the callbacks
were invoked with the current value or not to prevent callbacks from
being invoked in quick succeession with the same value by multiple
threads.
Realized that I was skipping invisible glyphs during construction of
MeasuredText. Once those were in, most of the issues vanished. A few
small tweaks and now it works surprisingly well.
- Blur no longer expands the shadow geometry, but instead is clamped to
avoid overlapping drawing calls.
- Overlay now handles hit tests correctly with regards to the original
relative widget.
- Align was using an Into conversion that wasn't actually correct,
causing the contents to not actually get aligned in some situations.