From f79b080d84002913b6388f8901822ba4a796bf90 Mon Sep 17 00:00:00 2001 From: vurtun Date: Mon, 23 Apr 2018 11:06:18 +0200 Subject: [PATCH] Fixed #674 popup and contextual combination problems --- nuklear.h | 2 ++ src/nuklear_contextual.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nuklear.h b/nuklear.h index 3ad2a9e..3dadfae 100644 --- a/nuklear.h +++ b/nuklear.h @@ -16925,6 +16925,8 @@ nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size, is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds); if (win->popup.active_con && win->popup.con_count != win->popup.active_con) return 0; + if (!is_open && win->popup.active_con) + win->popup.active_con = 0; if ((!is_open && !is_clicked)) return 0; diff --git a/src/nuklear_contextual.c b/src/nuklear_contextual.c index 539b8ed..5c88c2e 100644 --- a/src/nuklear_contextual.c +++ b/src/nuklear_contextual.c @@ -36,6 +36,8 @@ nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size, is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds); if (win->popup.active_con && win->popup.con_count != win->popup.active_con) return 0; + if (!is_open && win->popup.active_con) + win->popup.active_con = 0; if ((!is_open && !is_clicked)) return 0;