diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index d229419a958..323958de979 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7426,6 +7426,11 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * /* if but->pointype is set, but->poin should be too */ BLI_assert(!but->pointype || but->poin); + if (event->type == LEFTMOUSE && event->val == KM_PRESS && but->tip && + STREQ(but->tip, "Do channels contribute to result (toggle channel muting)")) { + printf(""); + } + /* Only hard-coded stuff here, button interactions with configurable * keymaps are handled using operators (see #ED_keymap_ui). */ diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 4acce793707..40d892cd970 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -545,12 +545,16 @@ typedef struct wmEvent { /** Generated by auto-repeat. */ char is_repeat; + /** Event is handled, used for testing whether to send double click events. */ + bool handled; + /** Previous state, used for double click and the 'click'. */ short prevtype; short prevval; int prevx, prevy; double prevclicktime; int prevclickx, prevclicky; + bool prev_handled; /** Modifier states. */ /** 'oskey' is apple or windows-key, value denotes order of pressed. */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index b500370d34d..7df7411b2e2 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2663,6 +2663,9 @@ static int wm_handlers_do_gizmo_handler(bContext *C, static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers) { + if (ISMOUSE_BUTTON(event->type)) { + printf("WM_HANDLERS_DO_INTERN\n"); + } const bool do_debug_handler = (G.debug & G_DEBUG_HANDLERS) && /* comment this out to flood the console! (if you really want to test) */ @@ -2831,6 +2834,9 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers /* this calls handlers twice - to solve (double-)click events */ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) { + if (ISMOUSE_BUTTON(event->type)) { + printf("WM_HANDLERS_DO\n"); + } int action = wm_handlers_do_intern(C, event, handlers); /* fileread case */ @@ -2959,6 +2965,12 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers) } } + if (ISMOUSE_BUTTON(event->type)) { + printf(" Set handled: %d\n", (wm_action_not_handled(action) == 0)); + } + event->handled = (wm_action_not_handled(action) == 0); + wmWindow *win = CTX_wm_window(C); + win->eventstate->handled = (wm_action_not_handled(action) == 0); return action; } @@ -4270,11 +4282,16 @@ static bool wm_event_is_double_click(const wmEvent *event, const wmEvent *event_ } else { if ((PIL_check_seconds_timer() - event_state->prevclicktime) * 1000 < U.dbl_click_time) { - return true; + printf(" DOUBLE EVENT (prev_handled: %d)\n", (int)event->prev_handled); + if (event->prev_handled == false) { + printf(" return true\n"); + return true; + } } } } + printf(" return false\n"); return false; } @@ -4432,6 +4449,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void /* copy previous state to prev event state (two old!) */ evt->prevval = evt->val; evt->prevtype = evt->type; + evt->prev_handled = evt->handled; + printf(" Copy handled: %d\n", evt->handled); /* copy to event state */ evt->val = event.val; @@ -4484,6 +4503,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void /* copy previous state to prev event state (two old!) */ evt->prevval = evt->val; evt->prevtype = evt->type; + evt->prev_handled = evt->handled; + printf(" Copy handled: %d\n", evt->handled); /* copy to event state */ evt->val = event.val;