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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2010-01-31 19:59:21 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2010-01-31 19:59:21 +0300
commit8d513efdb0cfd787afa45dedf523b5558d78d20e (patch)
tree71bbc84b75ae43e1e54fd925e42744015b4a1fe9 /source
parent127b3e6882ad92fe562d4e424295253755314bc1 (diff)
Fix snap to grid not taking the current grid resolution into
account in quad split 3d view. Now WM_OP_EXEC/INVOKE_REGION_WIN context stays in the current region if it is already a region of type window, so the operator gets executed in the right context.
Diffstat (limited to 'source')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c5
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c9
2 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 43e87e2ab60..9d7a58c457c 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -594,11 +594,12 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex
case WM_OP_EXEC_REGION_WIN:
case WM_OP_INVOKE_REGION_WIN:
{
- /* forces operator to go to the region window, for header menus */
+ /* forces operator to go to the region window, for header menus
+ but we stay in the same region if we are already in one */
ARegion *ar= CTX_wm_region(C);
ScrArea *area= CTX_wm_area(C);
- if(area) {
+ if(!(ar && ar->regiontype == RGN_TYPE_WINDOW) && area) {
ARegion *ar1= area->regionbase.first;
for(; ar1; ar1= ar1->next)
if(ar1->regiontype==RGN_TYPE_WINDOW)
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 24a66883ef7..86994e183fb 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -475,10 +475,11 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, const char *op
if(found==NULL) {
if(ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) {
if(sa) {
- ARegion *ar= sa->regionbase.first;
- for(; ar; ar= ar->next)
- if(ar->regiontype==RGN_TYPE_WINDOW)
- break;
+ if(!(ar && ar->regiontype == RGN_TYPE_WINDOW)) {
+ for(ar= sa->regionbase.first; ar; ar= ar->next)
+ if(ar->regiontype==RGN_TYPE_WINDOW)
+ break;
+ }
if(ar)
found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, hotkey, compare_props, keymap_r);