diff --git a/xwords4/common/board.c b/xwords4/common/board.c index f7783a9d3..9d7a0bbe3 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -2887,7 +2887,6 @@ XP_Bool board_focusChanged( BoardCtxt* board, BoardObjectType typ, XP_Bool gained ) { XP_Bool draw = XP_FALSE; - LOG_FUNC(); /* Called when there's been a decision to advance the focus to a new object, or when an object will lose it. Need to update internal data structures, but also to communicate to client draw code in a way that @@ -2926,7 +2925,6 @@ board_focusChanged( BoardCtxt* board, BoardObjectType typ, XP_Bool gained ) } } - LOG_RETURNF( "%d", (int)draw ); return draw; } /* board_focusChanged */ diff --git a/xwords4/palm/palmbt.c b/xwords4/palm/palmbt.c index 4d469d947..d2c893e0a 100644 --- a/xwords4/palm/palmbt.c +++ b/xwords4/palm/palmbt.c @@ -648,7 +648,7 @@ pbt_takedown_master( PalmBTStuff* btStuff ) LOG_RETURN_VOID(); } /* pbt_takedown_master */ -#ifdef DEBUG +#if 0 static void debug_logQueue( const PalmBTStuff* const btStuff ) { @@ -816,10 +816,10 @@ static void pbt_postpone( PalmBTStuff* btStuff, PBT_ACTION act ) { EventType eventToPost; - eventToPost.eType = nilEvent; + eventToPost.eType = noopEvent; + EvtAddEventToQueue( &eventToPost ); XP_LOGF( "%s(%s)", __func__, actToStr(act) ); - EvtAddEventToQueue( &eventToPost ); if ( DUPLICATES_OK(act) || (btStuff->queueLen == 0) diff --git a/xwords4/palm/palmmain.c b/xwords4/palm/palmmain.c index c244107df..a38dd9b99 100644 --- a/xwords4/palm/palmmain.c +++ b/xwords4/palm/palmmain.c @@ -2281,7 +2281,6 @@ handleFocusEvent( PalmAppGlobals* globals, const EventType* event, setFormFocus( globals->mainForm, objectID ); } } - LOG_RETURNF( "%d", (int)isBoardObj ); return isBoardObj; } /* handleFocusEvent */ #endif @@ -2521,6 +2520,12 @@ mainViewHandleEvent( EventPtr event ) draw = handled = handleNilEvent( globals ); break; + + case noopEvent: + /* do nothing! Exists just to force EvtGetEvent to return */ + XP_ASSERT( handled ); + break; + case newGameCancelEvent: /* If user cancelled the new game dialog that came up the first time he launched (i.e. when there's no game to fall back to) then just @@ -3825,6 +3830,7 @@ palm_util_setTimer( XW_UtilCtxt* uc, XWTimerReason why, { PalmAppGlobals* globals = (PalmAppGlobals*)uc->closure; XP_U32 now = TimGetTicks(); + EventType eventToPost; if ( why == TIMER_PENDOWN ) { now += PALM_TIMER_DELAY; @@ -3846,6 +3852,11 @@ palm_util_setTimer( XW_UtilCtxt* uc, XWTimerReason why, globals->timerProcs[why] = proc; globals->timerClosures[why] = closure; globals->timerFireAt[why] = now; + + /* Post an event to force us back out of EvtGetEvent. Required if this + * is called from inside some BT callback. */ + eventToPost.eType = noopEvent; + EvtAddEventToQueue( &eventToPost ); } /* palm_util_setTimer */ static void diff --git a/xwords4/palm/palmmain.h b/xwords4/palm/palmmain.h index 2da38058c..e7af641e0 100644 --- a/xwords4/palm/palmmain.h +++ b/xwords4/palm/palmmain.h @@ -357,7 +357,8 @@ struct PalmAppGlobals { }; /* PalmAppGlobals */ /* custom events */ -enum { dictSelectedEvent = firstUserEvent /* 0x6000 */ +enum { noopEvent = firstUserEvent /* 0x6000 */ + ,dictSelectedEvent ,newGameOkEvent ,newGameCancelEvent ,loadGameEvent