mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
Don't make any btlib calls until the main form is up. This works
around an (OS?) bug where, apparently, the confirm-turn-on-bt dialog eats pending events, including frmLoadEvent, so that the form never loads or is very broken if that dialog is allowed to come up too early.
This commit is contained in:
parent
ad77b04766
commit
b2f3e73672
1 changed files with 16 additions and 3 deletions
|
@ -1317,7 +1317,9 @@ figureWaitTicks( PalmAppGlobals* globals )
|
|||
/* XP_DEBUGF( "figureWaitTicks returning %d", result ); */
|
||||
|
||||
# ifdef XWFEATURE_BLUETOOTH
|
||||
palm_bt_amendWaitTicks( globals, &result );
|
||||
if ( !!globals->mainForm ) {
|
||||
palm_bt_amendWaitTicks( globals, &result );
|
||||
}
|
||||
# endif
|
||||
|
||||
return result;
|
||||
|
@ -1899,6 +1901,10 @@ initAndStartBoard( PalmAppGlobals* globals, XP_Bool newGame )
|
|||
}
|
||||
#endif
|
||||
|
||||
if ( !!globals->game.comms ) {
|
||||
comms_start( globals->game.comms );
|
||||
}
|
||||
|
||||
/* do this before drawing the board. If it assigns tiles, for example,
|
||||
that'll make a difference on the screen. */
|
||||
(void)server_do( globals->game.server );
|
||||
|
@ -3731,8 +3737,13 @@ palm_send( const XP_U8* buf, XP_U16 len,
|
|||
#endif
|
||||
#ifdef XWFEATURE_BLUETOOTH
|
||||
case COMMS_CONN_BT:
|
||||
result = palm_bt_send( buf, len, addr, btDataHandler, btConnHandler,
|
||||
globals );
|
||||
if ( !!globals->mainForm ) {
|
||||
result = palm_bt_send( buf, len, addr, btDataHandler,
|
||||
btConnHandler, globals );
|
||||
if ( result < 0 ) {
|
||||
userErrorFromStrId( globals, STR_BT_NOINIT );
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
|
@ -3828,6 +3839,7 @@ palm_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
|
|||
# ifdef XWFEATURE_BLUETOOTH
|
||||
XP_Bool isBT = COMMS_CONN_BT == newAddr->conType;
|
||||
if ( !isBT ) {
|
||||
XP_ASSERT( !!globals->mainForm );
|
||||
palm_bt_close( globals );
|
||||
showBTState( globals );
|
||||
}
|
||||
|
@ -3840,6 +3852,7 @@ palm_util_addrChange( XW_UtilCtxt* uc, const CommsAddrRec* oldAddr,
|
|||
# endif
|
||||
# ifdef XWFEATURE_BLUETOOTH
|
||||
} else if ( isBT ) {
|
||||
XP_ASSERT( !!globals->mainForm );
|
||||
if ( !palm_bt_init( globals, btDataHandler ) ) {
|
||||
userErrorFromStrId( globals, STR_BT_NOINIT );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue