2.5 Bugfixes
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 14 Sep 2009 20:48:05 +0000 (20:48 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 14 Sep 2009 20:48:05 +0000 (20:48 +0000)
#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.

source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/screen/screen_ops.c
source/blender/windowmanager/intern/wm_event_system.c

index b45ab2d4997dbb778427942adfbf377926ff26ef..921aa60f9b24ab4bdcb0b9e9ee6c06e9e27056a9 100644 (file)
@@ -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
index 3c6e12905d6983980694ee755b2931eaaa226940..221618b340e4226f5397898b3cdcfb069d755ce3 100644 (file)
@@ -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)
index 466c1d08ba31daeb5c8cabb50d7b6d17e0068fc3..152695c91622ad9f6de2977554e38b43122930ad 100644 (file)
@@ -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;
index 242ba31ccd49764b09bf0d625884cf717dd3c640..b6afc4daa9bde6bf308dfb00f1e170a2f5098a16 100644 (file)
@@ -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);
        }
index f32b11812cfe94278117816ee46458c65a1ec266..0bb1969ce3ce35ae1f9d698a2c26339fd1bf5b3f 100644 (file)
@@ -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);
                                }
index 28814937ebee9fd7f3da5b06b824b0ff6f1bcb7a..b5ecc6f4d589bbeceaa98b209500ca3d3a2bd05f 100644 (file)
@@ -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;