fix for crash in own recent commit. searchbox's need their own keynav state since they won't always be in a uiPopupBlockHandle.
This commit is contained in:
parent
075a655cc6
commit
acac5b8402
@ -183,6 +183,9 @@ typedef struct uiHandleButtonData {
|
||||
|
||||
/* search box (watch uiFreeActiveButtons) */
|
||||
ARegion *searchbox;
|
||||
#ifdef USE_KEYNAV_LIMIT
|
||||
struct uiKeyNavLock searchbox_keynav_state;
|
||||
#endif
|
||||
|
||||
/* post activate */
|
||||
uiButtonActivateType posttype;
|
||||
@ -2132,7 +2135,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
case MOUSEPAN:
|
||||
if (data->searchbox) {
|
||||
#ifdef USE_KEYNAV_LIMIT
|
||||
if ((event->type == MOUSEMOVE) && ui_mouse_motion_keynav_test(&block->handle->keynav_state, event)) {
|
||||
if ((event->type == MOUSEMOVE) && ui_mouse_motion_keynav_test(&data->searchbox_keynav_state, event)) {
|
||||
/* pass */
|
||||
}
|
||||
else {
|
||||
@ -2216,7 +2219,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
case DOWNARROWKEY:
|
||||
if (data->searchbox) {
|
||||
#ifdef USE_KEYNAV_LIMIT
|
||||
ui_mouse_motion_keynav_init(&block->handle->keynav_state, event);
|
||||
ui_mouse_motion_keynav_init(&data->searchbox_keynav_state, event);
|
||||
#endif
|
||||
ui_searchbox_event(C, data->searchbox, but, event);
|
||||
break;
|
||||
@ -2231,7 +2234,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
case UPARROWKEY:
|
||||
if (data->searchbox) {
|
||||
#ifdef USE_KEYNAV_LIMIT
|
||||
ui_mouse_motion_keynav_init(&block->handle->keynav_state, event);
|
||||
ui_mouse_motion_keynav_init(&data->searchbox_keynav_state, event);
|
||||
#endif
|
||||
ui_searchbox_event(C, data->searchbox, but, event);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user