Fixed window closing behavior

If a window was closed the remaining windows remain in read only mode.
This wrong behavior is now fixed.
This commit is contained in:
vurtun 2017-09-14 14:09:33 +02:00
parent 3b5123f523
commit 43b41f92bd
2 changed files with 10 additions and 3 deletions

View File

@ -11,6 +11,7 @@
Changes:
--------
- 2017/09/14 (2.00.1) - Fixed window closing behavior
- 2017/09/14 (2.00.0) - BREAKING CHANGE: Modifing window position and size funtions now
require the name of the window and must happen outside the window
building process (between function call nk_begin and nk_end).

View File

@ -17375,8 +17375,12 @@ nk_clear(struct nk_context *ctx)
/* remove hotness from hidden or closed windows*/
if (((iter->flags & NK_WINDOW_HIDDEN) ||
(iter->flags & NK_WINDOW_CLOSED)) &&
iter == ctx->active)
ctx->active = iter->next;
iter == ctx->active) {
ctx->active = iter->prev;
ctx->end = iter->prev;
if (ctx->active)
ctx->active->flags &= ~NK_WINDOW_ROM;
}
/* free unused popup windows */
if (iter->popup.win && iter->popup.win->seq != ctx->seq) {
@ -18577,8 +18581,10 @@ nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
* provided demo backends). */
NK_ASSERT(win->seq != ctx->seq);
win->seq = ctx->seq;
if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN))
if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN)) {
ctx->active = win;
ctx->end = win;
}
}
if (win->flags & NK_WINDOW_HIDDEN) {
ctx->current = win;