From e1cf1573b031fa934f9f9f324a9eea9b8b071567 Mon Sep 17 00:00:00 2001 From: ehouse Date: Thu, 20 Nov 2008 05:12:48 +0000 Subject: [PATCH] fix inval of focussed tile to take divider into account. --- common/board.c | 11 ++++++++--- common/boardp.h | 1 + common/tray.c | 6 +----- linux/Makefile | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/common/board.c b/common/board.c index 14a17abeb..8a1e0440f 100644 --- a/common/board.c +++ b/common/board.c @@ -1,4 +1,4 @@ -/* -*-mode: C; fill-column: 78; compile-command: "cd ../linux && make MEMDEBUG=TRUE"; -*- */ +/* -*- fill-column: 78; compile-command: "cd ../linux && make -j MEMDEBUG=TRUE"; -*- */ /* * Copyright 1997 - 2008 by Eric House (xwords@eehouse.org). All rights * reserved. @@ -2421,8 +2421,13 @@ invalFocusOwner( BoardCtxt* board ) break; case OBJ_TRAY: if ( board->focusHasDived ) { - XP_U16 loc = pti->trayCursorLoc; - board_invalTrayTiles( board, 1 << loc ); + XP_S16 loc = pti->trayCursorLoc; + if ( loc == pti->dividerLoc ) { + board->dividerInvalid = XP_TRUE; + } else { + adjustForDivider( board, &loc ); + board_invalTrayTiles( board, 1 << loc ); + } } else { board_invalTrayTiles( board, ALLTILES ); invalCellsUnderRect( board, &board->trayBounds ); diff --git a/common/boardp.h b/common/boardp.h index df7b330ca..0ff5a63ba 100644 --- a/common/boardp.h +++ b/common/boardp.h @@ -281,6 +281,7 @@ XP_Bool adjustYOffset( BoardCtxt* board, XP_S16 moveBy ); #ifdef KEYBOARD_NAV XP_Bool tray_moveCursor( BoardCtxt* board, XP_Key cursorKey, XP_Bool preflightOnly, XP_Bool* up ); +void adjustForDivider( const BoardCtxt* board, XP_S16* index ); XP_Bool tray_keyAction( BoardCtxt* board ); DrawFocusState dfsFor( BoardCtxt* board, BoardObjectType obj ); void shiftFocusUp( BoardCtxt* board, XP_Key key ); diff --git a/common/tray.c b/common/tray.c index 0737670c1..2bcd771e1 100644 --- a/common/tray.c +++ b/common/tray.c @@ -31,10 +31,6 @@ extern "C" { static void drawPendingScore( BoardCtxt* board, XP_Bool hasCursor ); static XP_U16 countTilesToShow( BoardCtxt* board ); static void figureDividerRect( BoardCtxt* board, XP_Rect* rect ); -#ifdef KEYBOARD_NAV -static void adjustForDivider( const BoardCtxt* board, XP_S16* index ); -#endif - static XP_S16 trayLocToIndex( BoardCtxt* board, XP_U16 loc ) @@ -548,7 +544,7 @@ board_juggleTray( BoardCtxt* board ) } /* board_juggleTray */ #ifdef KEYBOARD_NAV -static void +void adjustForDivider( const BoardCtxt* board, XP_S16* index ) { XP_U16 dividerLoc = board->selInfo->dividerLoc; diff --git a/linux/Makefile b/linux/Makefile index 78e5f6895..6c989e39a 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,4 +1,4 @@ -# -*- mode: makefile; compile-command: "make MEMDEBUG=TRUE"; -*- +# -*- mode: makefile; compile-command: "make -j MEMDEBUG=TRUE"; -*- # Copyright 2002-2007 by Eric House (xwords@eehouse.org). All rights # reserved. # @@ -24,7 +24,7 @@ PLATFORM = obj_linux_memdbg else DEFINES = PLATFORM = obj_linux_rel -CFLAGS += -Os -Werror +CFLAGS += -Os -Werror -Wunused endif DO_CURSES = -DPLATFORM_NCURSES