Browse Source

Fixed #657 contextual activation code

vurtun 7 years ago
parent
commit
d374953d27
2 changed files with 4 additions and 0 deletions
  1. 2 0
      nuklear.h
  2. 2 0
      src/nuklear_contextual.c

+ 2 - 0
nuklear.h

@@ -16894,6 +16894,8 @@ nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size,
     NK_ASSERT(ctx->current->layout);
     NK_ASSERT(ctx->current->layout);
     if (!ctx || !ctx->current || !ctx->current->layout)
     if (!ctx || !ctx->current || !ctx->current->layout)
         return 0;
         return 0;
+    if (ctx->current != ctx->active)
+        return 0;
 
 
     win = ctx->current;
     win = ctx->current;
     ++win->popup.con_count;
     ++win->popup.con_count;

+ 2 - 0
src/nuklear_contextual.c

@@ -25,6 +25,8 @@ nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size,
     NK_ASSERT(ctx->current->layout);
     NK_ASSERT(ctx->current->layout);
     if (!ctx || !ctx->current || !ctx->current->layout)
     if (!ctx || !ctx->current || !ctx->current->layout)
         return 0;
         return 0;
+    if (ctx->current != ctx->active)
+        return 0;
 
 
     win = ctx->current;
     win = ctx->current;
     ++win->popup.con_count;
     ++win->popup.con_count;