2.5 Bugfixes

#19302: the spin operator did not redo correct when changing properties.
Actually the problem was somewhere else, the search menu always did an
unnecessary undo push, which conflicted with an operator undo push with
the same name. Only in the case of "Spin" was this noticed, because it's
name is so short and you actually type it completely.
#19328: swapping areas could crash when dragging mouse outside the window.

Attempted fix for #19331, #19335 as well, where backspace and some other
keys give square characters instead of working as expected. Couldn't
reproducable here, so please test.
This commit is contained in:
Brecht Van Lommel 2009-09-14 20:48:05 +00:00
parent 1b2344a1f1
commit be69305d85
6 changed files with 8 additions and 5 deletions

@ -146,6 +146,7 @@ typedef struct uiLayout uiLayout;
#define UI_BUT_DRIVEN (1<<22)
#define UI_BUT_INACTIVE (1<<23)
#define UI_BUT_LAST_ACTIVE (1<<24)
#define UI_BUT_UNDO (1<<25)
#define UI_PANEL_WIDTH 340
#define UI_COMPACT_PANEL_WIDTH 160

@ -2264,6 +2264,9 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
}
}
if(!ELEM7(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX, SEARCH_MENU))
but->flag |= UI_BUT_UNDO;
BLI_addtail(&block->buttons, but);
if(block->curlayout)

@ -292,8 +292,7 @@ static void ui_apply_autokey_undo(bContext *C, uiBut *but)
uiAfterFunc *after;
char *str= NULL;
if ELEM6(but->type, BLOCK, BUT, LABEL, PULLDOWN, ROUNDBOX, LISTBOX);
else {
if(but->flag & UI_BUT_UNDO) {
/* define which string to use for undo */
if ELEM(but->type, LINK, INLINK) str= "Add button link";
else if ELEM(but->type, MENU, ICONTEXTROW) str= but->drawstr;

@ -1107,7 +1107,7 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
but->hardmax= MAX2(but->hardmax, 256);
but->rnasearchpoin= *searchptr;
but->rnasearchprop= searchprop;
but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT;
but->flag |= UI_ICON_LEFT|UI_TEXT_LEFT|UI_BUT_UNDO;
uiButSetSearchFunc(but, rna_search_cb, but, NULL, NULL);
}

@ -605,7 +605,7 @@ static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event)
break;
case LEFTMOUSE: /* release LMB */
if(event->val==0) {
if(sad->sa1 == sad->sa2) {
if(!sad->sa2 || sad->sa1 == sad->sa2) {
return area_swap_cancel(C, op);
}

@ -715,7 +715,7 @@ static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi)
/* the matching rules */
if(kmitype==KM_TEXTINPUT)
if(ISKEYBOARD(winevent->type)) return 1;
if(ISKEYBOARD(winevent->type) && winevent->ascii) return 1;
if(kmitype!=KM_ANY)
if(winevent->type!=kmitype) return 0;