Fix #36030: datablock drag and drop to buttons not working with a certain number
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 9 Jul 2013 11:31:49 +0000 (11:31 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 9 Jul 2013 11:31:49 +0000 (11:31 +0000)
of objects in the scene.

source/blender/editors/interface/interface_handlers.c

index 342c0569f411080939c13a1f3f9c72b2be195b8e..8782076798eb421f5ac981d8022424dfc03f0706 100644 (file)
@@ -1297,9 +1297,14 @@ static void ui_but_drop(bContext *C, const wmEvent *event, uiBut *but, uiHandleB
                        if (ELEM3(but->type, TEX, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                                ID *id = (ID *)wmd->poin;
                                
-                               if (but->poin == NULL && but->rnapoin.data == NULL) {}
                                button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING);
                                BLI_strncpy(data->str, id->name + 2, data->maxlen);
+
+                               if (ELEM(but->type, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
+                                       but->changed = true;
+                                       ui_searchbox_update(C, data->searchbox, but, true);
+                               }
+
                                button_activate_state(C, but, BUTTON_STATE_EXIT);
                        }
                }
@@ -1420,6 +1425,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
 
                        if (ELEM(but->type, SEARCH_MENU, SEARCH_MENU_UNLINK)) {
                                /* else uiSearchboxData.active member is not updated [#26856] */
+                               but->changed = true;
                                ui_searchbox_update(C, data->searchbox, but, true);
                        }
                        button_activate_state(C, but, BUTTON_STATE_EXIT);