Page MenuHome

Fix T69200: Resetting default value does not work in popovers or menus
Needs ReviewPublic

Authored by Fabrício Luis (ce3po) on Nov 20 2020, 3:31 AM.

Details

Reviewers
None
Group Reviewers
User Interface
Summary

Problem

In Sculpting Mode when click RMB and click RMB in Strength many options stay disabled. (T69200)

Solution

Change region where activebut will be searched for the ui_context_button_active function.
Set region where but is active before call ui_popup_context_menu_for_button in ui_do_button function.

Description

This happens because the WM_operator_poll_context function in UI_block_end_ex return false when invoke
some functions poll (ex.: copy_data_path_button_poll, copy_as_driver_button_poll, reset_default_button_poll) that
call UI_context_active_but_prop_get returning a activebut out of popup menu.

When checking code sequence:

uiBut *UI_context_active_but_prop_get(const bContext *C, struct PointerRNA *r_ptr, struct PropertyRNA **r_prop, int *r_index)
  static uiBut *ui_context_rna_button_active(const bContext *C)
    return ui_context_button_active(CTX_wm_region(C), ui_context_rna_button_active_test);
      the CTX_wm_region(C) function return a different region from where clicked at the mouse.

This fix is very similar are: D9395 and D9538.

Diff Detail

Repository
rB Blender
Branch
fix_T69200 (branched from master)
Build Status
Buildable 11354
Build 11354: arc lint + arc unit