diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-18 08:26:31 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-09-18 08:26:31 +0300 |
commit | 95941a8fca886ba258716c535d51d0d68d075993 (patch) | |
tree | 0be54cd99abf2da1bbc426485c6a980546a6a3a9 /src/ui/root.c | |
parent | daaf3e72b472e05a4378a7789c6ebedd9b0e9b6e (diff) |
Tracking hover widget; cleanup
The hover widget may get deleted during event processing, so Window keeps track of it for refreshing.
TODO: Random crash when a destroyed menu is still in the onTop array (?).
Diffstat (limited to 'src/ui/root.c')
-rw-r--r-- | src/ui/root.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ui/root.c b/src/ui/root.c index 71f53af4..21bed366 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -271,13 +271,15 @@ void destroyPending_Root(iRoot *d) { | |||
271 | setCurrent_Root(d); | 271 | setCurrent_Root(d); |
272 | iForEach(PtrSet, i, d->pendingDestruction) { | 272 | iForEach(PtrSet, i, d->pendingDestruction) { |
273 | iWidget *widget = *i.value; | 273 | iWidget *widget = *i.value; |
274 | iAssert(widget->root == d); | ||
274 | if (!isFinished_Anim(&widget->visualOffset) || | 275 | if (!isFinished_Anim(&widget->visualOffset) || |
275 | isBeingVisuallyOffsetByReference_Widget(widget)) { | 276 | isBeingVisuallyOffsetByReference_Widget(widget)) { |
276 | continue; | 277 | continue; |
277 | } | 278 | } |
278 | if (widget->flags & keepOnTop_WidgetFlag) { | 279 | if (widget->flags & keepOnTop_WidgetFlag) { |
279 | removeOne_PtrArray(onTop_Root(widget->root), widget); | 280 | removeOne_PtrArray(d->onTop, widget); |
280 | } | 281 | } |
282 | iAssert(indexOf_PtrArray(d->onTop, widget) == iInvalidPos); | ||
281 | if (widget->parent) { | 283 | if (widget->parent) { |
282 | removeChild_Widget(widget->parent, widget); | 284 | removeChild_Widget(widget->parent, widget); |
283 | } | 285 | } |