Fix #107422: Mesh context menus do not open with the last used option #107427

Merged
Philipp Oeser merged 3 commits from lichtwerk/blender:107422 into main 2023-05-17 10:41:23 +02:00

3 Commits

Author SHA1 Message Date
Philipp Oeser 6e0d60f9a1 improve comment 2023-05-17 10:03:38 +02:00
Philipp Oeser 4a9becab7f Merge branch 'main' into 107422 2023-05-17 09:53:19 +02:00
Philipp Oeser f26fc831f8 Fix #107422: Mesh context menus do not open with the last used option
Caused by 99e5024e97

Above commit changed behavior in that it only flagged the `uiBlock` with
`UI_BLOCK_POPUP_MEMORY` in case a Menu's title was provided to
`ui_popup_menu_create_block`. Now when is the title provided? This
depends on the `bl_label` set in the menu class. But this is not always
the case, there are some menus that have a blank `bl_label` (as seen
with `VIEW3D_MT_edit_mesh_context_menu` for example -- this specifies its
own label inside the draw function depending on vertex/edge/face mode).
Thus the provided title is not really reliable as source information to
do the flagging (also see for example
a38b98478a), flagging should **always** be
done [and only check a title for actually inserting in the puphash].

Now why does this still work for menus **not** providing a title? This
is because `button_activate_exit` will also handle the puphash when
choosing a menu entry and does `ui_popup_menu_memory_set`. So we are all
good here.
2023-04-28 11:38:27 +02:00