diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-23 09:11:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-23 09:12:55 +0300 |
commit | 51279107491472a37d3abfb8b21b8bbc24e185e3 (patch) | |
tree | 41e900a2a69cd0e814ace4cbcf84f774e05784fe /source/blender/windowmanager | |
parent | 171c756f2006cf0e839fc9fcdd6b0cadebfe699a (diff) | |
parent | 6618852b7f11fe097dfe817d6af09e4d535e000e (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index f8e99edfbc9..4449736d2a5 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -416,6 +416,7 @@ struct MenuType *WM_menutype_find(const char *idname, bool quiet); bool WM_menutype_add(struct MenuType *mt); void WM_menutype_freelink(struct MenuType *mt); void WM_menutype_free(void); +bool WM_menutype_poll(struct bContext *C, struct MenuType *mt); /* wm_gesture_ops.c */ int WM_gesture_border_invoke (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 623a7af5165..344c2ff1725 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -339,6 +339,14 @@ void WM_menutype_free(void) menutypes_hash = NULL; } +bool WM_menutype_poll(bContext *C, MenuType *mt) +{ + if (mt->poll != NULL) { + return mt->poll(C, mt); + } + return true; +} + /* ****************************************** */ void WM_keymap_init(bContext *C) |