From 9e7dc62cd8b5bc60484e205fae65ff18a5c5b9ef Mon Sep 17 00:00:00 2001 From: Leonard Ritter Date: Fri, 19 Sep 2014 11:29:40 +0200 Subject: [PATCH] context clicks go directly through --- oui.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/oui.h b/oui.h index 44fcd9d..1852a18 100644 --- a/oui.h +++ b/oui.h @@ -638,11 +638,15 @@ OUI_EXPORT int uiGetAbove(int item); #define UI_MAX_KIND 16 -#define UI_ANY_MOUSE_INPUT (UI_BUTTON0_DOWN \ +#define UI_ANY_BUTTON0_INPUT (UI_BUTTON0_DOWN \ |UI_BUTTON0_UP \ |UI_BUTTON0_HOT_UP \ - |UI_BUTTON0_CAPTURE \ - |UI_BUTTON2_DOWN) + |UI_BUTTON0_CAPTURE) + +#define UI_ANY_BUTTON2_INPUT (UI_BUTTON2_DOWN) + +#define UI_ANY_MOUSE_INPUT (UI_ANY_BUTTON0_INPUT \ + |UI_ANY_BUTTON2_INPUT) #define UI_ANY_KEY_INPUT (UI_KEY_DOWN \ |UI_KEY_UP \ @@ -1551,10 +1555,14 @@ void uiProcess(int timestamp) { uiNotifyItem(active_item, UI_BUTTON0_DOWN); } ui_context->state = UI_STATE_CAPTURE; - } else if (uiGetButton(2) && !uiGetLastButton(2) && (hot >= 0)) { + } else if (uiGetButton(2) && !uiGetLastButton(2)) { hot_item = -1; - ui_context->active_rect = ui_context->hot_rect; - uiNotifyItem(hot, UI_BUTTON2_DOWN); + hot = uiFindItemForEvent(0, UI_BUTTON2_DOWN, + &ui_context->active_rect, + ui_context->cursor.x, ui_context->cursor.y, 0, 0); + if (hot >= 0) { + uiNotifyItem(hot, UI_BUTTON2_DOWN); + } } else { hot_item = hot; }