Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-01-13 06:58:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-01-13 07:00:15 +0300
commitddb958ae998c1fc1a6bfb068e8dd545ebf6ed160 (patch)
treeb80728e597422e368b843bae13be759ffb0b1100 /source/blender
parentd5042c42501c4d12f4e6562c32caaa88e4e6cacd (diff)
Cleanup: remove hack that set operator id in the wmEvent
This can be replaced by passing an argument.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/windowmanager/WM_types.h3
-rw-r--r--source/blender/windowmanager/intern/wm_event_query.c3
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c19
3 files changed, 9 insertions, 16 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 0c3a5f92113..e9e4b7c6d12 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -548,9 +548,6 @@ typedef struct wmEvent {
char check_drag;
char is_motion_absolute;
- /** Keymap item, set by handler (weak?). */
- const char *keymap_idname;
-
/** Tablet info, only use when the tablet is active. */
const struct wmTabletData *tablet_data;
diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c
index e37f3b946fe..86d92a473ff 100644
--- a/source/blender/windowmanager/intern/wm_event_query.c
+++ b/source/blender/windowmanager/intern/wm_event_query.c
@@ -68,7 +68,7 @@ void WM_event_print(const wmEvent *event)
printf(
"wmEvent type:%d / %s, val:%d / %s,\n"
" shift:%d, ctrl:%d, alt:%d, oskey:%d, keymodifier:%d,\n"
- " mouse:(%d,%d), ascii:'%c', utf8:'%.*s', keymap_idname:%s, pointer:%p\n",
+ " mouse:(%d,%d), ascii:'%c', utf8:'%.*s', pointer:%p\n",
event->type,
type_id,
event->val,
@@ -83,7 +83,6 @@ void WM_event_print(const wmEvent *event)
event->ascii,
BLI_str_utf8_size(event->utf8_buf),
event->utf8_buf,
- event->keymap_idname,
(const void *)event);
#ifdef WITH_INPUT_NDOF
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 52acf026f3b..eebef43c0f6 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1966,7 +1966,8 @@ static int wm_handler_operator_call(bContext *C,
ListBase *handlers,
wmEventHandler *handler_base,
wmEvent *event,
- PointerRNA *properties)
+ PointerRNA *properties,
+ const char *kmi_idname)
{
int retval = OPERATOR_PASS_THROUGH;
@@ -2068,7 +2069,7 @@ static int wm_handler_operator_call(bContext *C,
}
}
else {
- wmOperatorType *ot = WM_operatortype_find(event->keymap_idname, 0);
+ wmOperatorType *ot = WM_operatortype_find(kmi_idname, 0);
if (ot && wm_operator_check_locked_interface(C, ot)) {
bool use_last_properties = true;
@@ -2406,10 +2407,8 @@ static int wm_handlers_do_keymap_with_keymap_handler(
PRINT("%s: item matched '%s'\n", __func__, kmi->idname);
- /* weak, but allows interactive callback to not use rawkey */
- event->keymap_idname = kmi->idname;
-
- action |= wm_handler_operator_call(C, handlers, &handler->head, event, kmi->ptr);
+ action |= wm_handler_operator_call(
+ C, handlers, &handler->head, event, kmi->ptr, kmi->idname);
if (action & WM_HANDLER_BREAK) {
/* not always_pass here, it denotes removed handler_base */
@@ -2463,13 +2462,11 @@ static int wm_handlers_do_keymap_with_gizmo_handler(
if (wm_eventmatch(event, kmi)) {
PRINT("%s: item matched '%s'\n", __func__, kmi->idname);
- /* weak, but allows interactive callback to not use rawkey */
- event->keymap_idname = kmi->idname;
-
CTX_wm_gizmo_group_set(C, gzgroup);
/* handler->op is called later, we want keymap op to be triggered here */
- action |= wm_handler_operator_call(C, handlers, &handler->head, event, kmi->ptr);
+ action |= wm_handler_operator_call(
+ C, handlers, &handler->head, event, kmi->ptr, kmi->idname);
CTX_wm_gizmo_group_set(C, NULL);
@@ -2760,7 +2757,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
}
}
else {
- action |= wm_handler_operator_call(C, handlers, handler_base, event, NULL);
+ action |= wm_handler_operator_call(C, handlers, handler_base, event, NULL, NULL);
}
}
else {