Bug fix 33732

Modal operators with hardcoded (in C) event handling now don't get
double clicks anymore. For modal keymaps things work OK.

This fixes number input typing for CTRL+B bevel, for example.
This commit is contained in:
Ton Roosendaal
2013-01-10 11:08:38 +00:00
parent 860d42b9a3
commit bed3618780

View File

@@ -1345,6 +1345,15 @@ static void wm_event_modalkeymap(const bContext *C, wmOperator *op, wmEvent *eve
}
}
}
else {
/* modal keymap checking returns handled events fine, but all hardcoded modal
handling typically swallows all events (OPERATOR_RUNNING_MODAL).
This bypass just disables support for double clicks in hardcoded modal handlers */
if (event->val == KM_DBL_CLICK) {
event->prevval = event->val;
event->val = KM_PRESS;
}
}
}
/* bad hacking event system... better restore event type for checking of KM_CLICK for example */
@@ -1357,6 +1366,8 @@ static void wm_event_modalmap_end(wmEvent *event)
event->val = event->prevval;
event->prevval = 0;
}
else if (event->prevval == KM_DBL_CLICK)
event->val = KM_DBL_CLICK;
}