Alternative fix for crash displaying 'New Window' keymap item
rB870440dee910c9 just did NULL-check for Main pointer, actual issue is that bContext pointer was NULL. This can be fixed by ensuring PROP_ENUM_NO_CONTEXT flag is not set by calling WM_operator_properties_sanitize when creating RNA buttons. Now, layout previews are visible in keymap editor too.
This commit is contained in:
@@ -3684,6 +3684,8 @@ static void template_keymap_item_properties(uiLayout *layout, const char *title,
|
|||||||
{
|
{
|
||||||
uiLayout *flow, *box, *row;
|
uiLayout *flow, *box, *row;
|
||||||
|
|
||||||
|
WM_operator_properties_sanitize(ptr, false);
|
||||||
|
|
||||||
uiItemS(layout);
|
uiItemS(layout);
|
||||||
|
|
||||||
if (title)
|
if (title)
|
||||||
|
|||||||
@@ -817,7 +817,6 @@ struct EnumPropertyItem *wm_window_new_screen_itemf(
|
|||||||
* for dynamic strings in EnumPropertyItem.name to avoid this. */
|
* for dynamic strings in EnumPropertyItem.name to avoid this. */
|
||||||
static char active_screens[20][MAX_NAME + 12];
|
static char active_screens[20][MAX_NAME + 12];
|
||||||
|
|
||||||
if (bmain) {
|
|
||||||
for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
|
for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) {
|
||||||
if (screen->winid) {
|
if (screen->winid) {
|
||||||
BLI_snprintf(active_screens[count_act_screens], sizeof(*active_screens), "%s (Duplicate)",
|
BLI_snprintf(active_screens[count_act_screens], sizeof(*active_screens), "%s (Duplicate)",
|
||||||
@@ -836,7 +835,6 @@ struct EnumPropertyItem *wm_window_new_screen_itemf(
|
|||||||
RNA_enum_item_add(&item, &totitem, &tmp);
|
RNA_enum_item_add(&item, &totitem, &tmp);
|
||||||
value++;
|
value++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RNA_enum_item_end(&item, &totitem);
|
RNA_enum_item_end(&item, &totitem);
|
||||||
*r_free = true;
|
*r_free = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user