diff options
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index a7fc0cfec25..52933a89045 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2386,8 +2386,8 @@ static void ui_but_copy_curvemapping(uiBut *but) { if (but->poin != NULL) { but_copypaste_curve_alive = true; - curvemapping_free_data(&but_copypaste_curve); - curvemapping_copy_data(&but_copypaste_curve, (CurveMapping *)but->poin); + BKE_curvemapping_free_data(&but_copypaste_curve); + BKE_curvemapping_copy_data(&but_copypaste_curve, (CurveMapping *)but->poin); } } @@ -2399,8 +2399,8 @@ static void ui_but_paste_curvemapping(bContext *C, uiBut *but) } button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); - curvemapping_free_data((CurveMapping *)but->poin); - curvemapping_copy_data((CurveMapping *)but->poin, &but_copypaste_curve); + BKE_curvemapping_free_data((CurveMapping *)but->poin); + BKE_curvemapping_copy_data((CurveMapping *)but->poin, &but_copypaste_curve); button_activate_state(C, but, BUTTON_STATE_EXIT); } } @@ -2588,7 +2588,7 @@ static void ui_but_paste(bContext *C, uiBut *but, uiHandleButtonData *data, cons void ui_but_clipboard_free(void) { - curvemapping_free_data(&but_copypaste_curve); + BKE_curvemapping_free_data(&but_copypaste_curve); } /** \} */ @@ -6479,7 +6479,7 @@ static bool ui_numedit_but_CURVE(uiBlock *block, } } - curvemapping_changed(cumap, false); + BKE_curvemapping_changed(cumap, false); if (moved_point) { data->draglastx = evtx; @@ -6559,8 +6559,8 @@ static int ui_do_but_CURVE( float f_xy[2]; BLI_rctf_transform_pt_v(&cumap->curr, &but->rect, f_xy, m_xy); - curvemap_insert(cuma, f_xy[0], f_xy[1]); - curvemapping_changed(cumap, false); + BKE_curvemap_insert(cuma, f_xy[0], f_xy[1]); + BKE_curvemapping_changed(cumap, false); changed = true; } @@ -6597,8 +6597,8 @@ static int ui_do_but_CURVE( if (dist_squared_to_line_segment_v2(m_xy, f_xy_prev, f_xy) < dist_min_sq) { BLI_rctf_transform_pt_v(&cumap->curr, &but->rect, f_xy, m_xy); - curvemap_insert(cuma, f_xy[0], f_xy[1]); - curvemapping_changed(cumap, false); + BKE_curvemap_insert(cuma, f_xy[0], f_xy[1]); + BKE_curvemapping_changed(cumap, false); changed = true; @@ -6672,7 +6672,7 @@ static int ui_do_but_CURVE( } } else { - curvemapping_changed(cumap, true); /* remove doubles */ + BKE_curvemapping_changed(cumap, true); /* remove doubles */ BKE_paint_invalidate_cursor_overlay(scene, view_layer, cumap); } } @@ -10113,31 +10113,18 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSE if (but) { bScreen *screen = CTX_wm_screen(C); - ARegion *ar_temp; uiBut *but_other; uiHandleButtonData *data; - bool is_inside_menu = false; - - /* look for a popup menu containing the mouse */ - for (ar_temp = screen->regionbase.first; ar_temp; ar_temp = ar_temp->next) { - rcti winrct; - - ui_region_winrct_get_no_margin(ar_temp, &winrct); - - if (BLI_rcti_isect_pt_v(&winrct, &event->x)) { - BLI_assert(ar_temp->type->regionid == RGN_TYPE_TEMPORARY); - - is_inside_menu = true; - break; - } - } /* handle activated button events */ data = but->active; if ((data->state == BUTTON_STATE_MENU_OPEN) && + /* Make sure this popup isn't dragging a button. + * can happen with popovers (see T67882). */ + (ui_region_find_active_but(data->menu->region) == NULL) && /* make sure mouse isn't inside another menu (see T43247) */ - (is_inside_menu == false) && + (ui_screen_region_find_mouse_over(screen, event) == NULL) && (ELEM(but->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER, UI_BTYPE_MENU)) && (but_other = ui_but_find_mouse_over(ar, event)) && (but != but_other) && (ELEM(but_other->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER, UI_BTYPE_MENU))) { |