Fix #112028: Ctrl+Alt+Scroll not working on all selected objects #112095

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:112028_b into main 2023-09-11 15:33:45 +02:00
1 changed files with 17 additions and 10 deletions

View File

@ -278,12 +278,12 @@ static void ui_selectcontext_apply(bContext *C,
const double value_orig); const double value_orig);
/** /**
* Only respond to events which are expected to be used for multi button editing, * Ideally we would only respond to events which are expected to be used for multi button editing
* e.g. ALT is also used for button array pasting, see #108096. * (additionally checking if this is a mouse[wheel] or returnkey event to avoid the ALT conflict
*/ * with button array pasting, see #108096, but unfortunately wheel events are not part of
# define IS_ALLSELECT_EVENT(event) \ * win->eventstate with modifiers held down. Instead, the conflict is avoided by specifically
(((event)->modifier & KM_ALT) != 0 && \ * filtering out CTRL ALT V in ui_apply_but(). */
(ISMOUSE((event)->type) || ELEM((event)->type, EVT_RETKEY, EVT_PADENTER))) # define IS_ALLSELECT_EVENT(event) (((event)->modifier & KM_ALT) != 0)
/** just show a tinted color so users know its activated */ /** just show a tinted color so users know its activated */
# define UI_BUT_IS_SELECT_CONTEXT UI_BUT_NODE_ACTIVE # define UI_BUT_IS_SELECT_CONTEXT UI_BUT_NODE_ACTIVE
@ -2267,10 +2267,17 @@ static void ui_apply_but(
if (data->select_others.elems_len == 0) if (data->select_others.elems_len == 0)
{ {
wmWindow *win = CTX_wm_window(C); wmWindow *win = CTX_wm_window(C);
/* may have been enabled before activating */ wmEvent *event = win->eventstate;
if (data->select_others.is_enabled || IS_ALLSELECT_EVENT(win->eventstate)) { /* May have been enabled before activating, dont do for array pasting. */
ui_selectcontext_begin(C, but, &data->select_others); if (data->select_others.is_enabled || IS_ALLSELECT_EVENT(event)) {
data->select_others.is_enabled = true; /* See comment for IS_ALLSELECT_EVENT why this needs to be filtered here. */
const bool is_array_paste = (event->val == KM_PRESS) &&
(event->modifier & (KM_CTRL | KM_OSKEY)) &&
(event->modifier & KM_SHIFT) == 0 && (event->type == EVT_VKEY);
if (!is_array_paste) {
ui_selectcontext_begin(C, but, &data->select_others);
data->select_others.is_enabled = true;
}
} }
} }
if (data->select_others.elems_len == 0) { if (data->select_others.elems_len == 0) {