diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 12 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_event_system.h | 1 |
3 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 7dc30695862..ef89b2b35ad 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -111,9 +111,9 @@ static void wm_method_draw_full(bContext *C, wmWindow *win) /* draw overlapping regions */ for(ar=screen->regionbase.first; ar; ar= ar->next) { if(ar->swinid) { - CTX_wm_region_set(C, ar); + CTX_wm_menu_set(C, ar); ED_region_do_draw(C, ar); - CTX_wm_region_set(C, NULL); + CTX_wm_menu_set(C, NULL); } } @@ -245,9 +245,9 @@ static void wm_method_draw_overlap_all(bContext *C, wmWindow *win) /* draw marked overlapping regions */ for(ar=screen->regionbase.first; ar; ar= ar->next) { if(ar->swinid && ar->do_draw) { - CTX_wm_region_set(C, ar); + CTX_wm_menu_set(C, ar); ED_region_do_draw(C, ar); - CTX_wm_region_set(C, NULL); + CTX_wm_menu_set(C, NULL); } } @@ -558,9 +558,9 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) /* draw overlapping regions */ for(ar=screen->regionbase.first; ar; ar= ar->next) { if(ar->swinid) { - CTX_wm_region_set(C, ar); + CTX_wm_menu_set(C, ar); ED_region_do_draw(C, ar); - CTX_wm_region_set(C, NULL); + CTX_wm_menu_set(C, NULL); } } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 772b308fb62..283f0819996 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -549,14 +549,17 @@ void WM_event_remove_handlers(bContext *C, ListBase *handlers) else if(handler->ui_remove) { ScrArea *area= CTX_wm_area(C); ARegion *region= CTX_wm_region(C); + ARegion *menu= CTX_wm_menu(C); if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area); if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region); + if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu); handler->ui_remove(C, handler->ui_userdata); CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); + CTX_wm_menu_set(C, menu); } wm_event_free_handler(handler); @@ -726,11 +729,13 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve { ScrArea *area= CTX_wm_area(C); ARegion *region= CTX_wm_region(C); + ARegion *menu= CTX_wm_menu(C); int retval; /* we set context to where ui handler came from */ if(handler->ui_area) CTX_wm_area_set(C, handler->ui_area); if(handler->ui_region) CTX_wm_region_set(C, handler->ui_region); + if(handler->ui_menu) CTX_wm_menu_set(C, handler->ui_menu); retval= handler->ui_handle(C, event, handler->ui_userdata); @@ -738,11 +743,13 @@ static int wm_handler_ui_call(bContext *C, wmEventHandler *handler, wmEvent *eve if((retval != WM_UI_HANDLER_BREAK) || wm_event_always_pass(event)) { CTX_wm_area_set(C, area); CTX_wm_region_set(C, region); + CTX_wm_menu_set(C, menu); } else { /* this special cases is for areas and regions that get removed */ CTX_wm_area_set(C, NULL); CTX_wm_region_set(C, NULL); + CTX_wm_menu_set(C, NULL); } if(retval == WM_UI_HANDLER_BREAK) @@ -1197,6 +1204,7 @@ wmEventHandler *WM_event_add_ui_handler(bContext *C, ListBase *handlers, wmUIHan handler->ui_userdata= userdata; handler->ui_area= (C)? CTX_wm_area(C): NULL; handler->ui_region= (C)? CTX_wm_region(C): NULL; + handler->ui_menu= (C)? CTX_wm_menu(C): NULL; BLI_addhead(handlers, handler); diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index 930f20dfa63..99853c77a55 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -58,6 +58,7 @@ typedef struct wmEventHandler { void *ui_userdata; /* user data pointer */ struct ScrArea *ui_area; /* for derived/modal handlers */ struct ARegion *ui_region; /* for derived/modal handlers */ + struct ARegion *ui_menu; /* for derived/modal handlers */ /* fileselect handler re-uses modal operator data */ struct bScreen *filescreen; /* screen it started in, to validate exec */ |