diff options
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 92fa3754d3a..81ecfedf62c 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1965,12 +1965,9 @@ static void wm_handler_op_context_get_if_valid(bContext *C, region = NULL; } - if (region == NULL) { - LISTBASE_FOREACH (ARegion *, region_iter, &area->regionbase) { - region = region_iter; - if (region == handler->context.region) { - break; - } + if ((region == NULL) && handler->context.region) { + if (BLI_findindex(&area->regionbase, handler->context.region) != -1) { + region = handler->context.region; } } |