From 414580904fe44de6cf52e7bb3b5bcfc194421e07 Mon Sep 17 00:00:00 2001 From: ehouse Date: Wed, 8 Nov 2006 05:04:44 +0000 Subject: [PATCH] board doesn't handle focus-related keys unless it has the focus. --- xwords4/common/board.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 47ab28bcb..89a87072b 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -2717,7 +2717,7 @@ board_handleKey( BoardCtxt* board, XP_Key key ) } else if ( board->focussed == OBJ_TRAY ) { result = tray_moveCursor( board, key ); } - } else { + } else if ( board->focussed != OBJ_NONE ) { invalFocusOwner( board ); shiftFocusUp( board, key ); result = XP_TRUE; @@ -2734,8 +2734,10 @@ board_handleKey( BoardCtxt* board, XP_Key key ) #ifdef KEYBOARD_NAV case XP_FOCUSCHANGE_KEY: - shiftFocusUp( board, XP_CURSOR_KEY_RIGHT ); - result = XP_TRUE; + if ( board->focussed != OBJ_NONE ) { + shiftFocusUp( board, XP_CURSOR_KEY_RIGHT ); + result = XP_TRUE; + } break; case XP_RETURN_KEY: @@ -2880,6 +2882,7 @@ void shiftFocusUp( BoardCtxt* board, XP_Key key ) { BoardObjectType next = OBJ_NONE; + XP_ASSERT( board->focussed != OBJ_NONE ); util_notifyFocusChange( board->util, board->focussed, key, &next ); if ( board->focussed != next ) {