Drop keyUp events not preceeded by keyDowns to catch leaks from

dismissed dialogs; don't drop first keyDown on OS4 since the bug that
works around isn't there; turn BT back off by default.
This commit is contained in:
ehouse 2007-02-04 04:10:11 +00:00
parent 45b47c115f
commit aac30fffea
3 changed files with 12 additions and 4 deletions

View file

@ -119,7 +119,7 @@ MYDEFS_COMMON += -DXWFEATURE_SEARCHLIMIT
# MYDEFS_COMMON += -DXWFEATURE_RELAY # MYDEFS_COMMON += -DXWFEATURE_RELAY
# turn on bluetooth comms option for 68K and ARM -- which won't work yet # turn on bluetooth comms option for 68K and ARM -- which won't work yet
BLUETOOTH = -DXWFEATURE_BLUETOOTH #BLUETOOTH = -DXWFEATURE_BLUETOOTH
#MYDEFS_COMMON += $(BLUETOOTH) #MYDEFS_COMMON += $(BLUETOOTH)
# Add menu allowing to choose to run 68K or ARM # Add menu allowing to choose to run 68K or ARM

View file

@ -953,6 +953,7 @@ initHighResGlobals( PalmAppGlobals* globals )
XP_U32 vers; XP_U32 vers;
err = FtrGet( sysFtrCreator, sysFtrNumWinVersion, &vers ); err = FtrGet( sysFtrCreator, sysFtrNumWinVersion, &vers );
XP_ASSERT( err == errNone );
globals->hasHiRes = (err == errNone) && (vers >= 4) && !globals->isZodiac; globals->hasHiRes = (err == errNone) && (vers >= 4) && !globals->isZodiac;
XP_LOGF( "hasHiRes = %d", (XP_U16)globals->hasHiRes ); XP_LOGF( "hasHiRes = %d", (XP_U16)globals->hasHiRes );
globals->oneDotFiveAvail = globals->hasHiRes globals->oneDotFiveAvail = globals->hasHiRes
@ -2358,7 +2359,6 @@ handleKeyEvent( PalmAppGlobals* globals, const EventType* event,
/* remove this and break focus drilldown. Why? */ /* remove this and break focus drilldown. Why? */
handled = draw; handled = draw;
} }
LOG_RETURNF( "%d", draw );
*handledP = handled; *handledP = handled;
globals->handlingKeyEvent = XP_FALSE; globals->handlingKeyEvent = XP_FALSE;
@ -2805,8 +2805,14 @@ mainViewHandleEvent( EventPtr event )
case keyUpEvent: case keyUpEvent:
XP_ASSERT( globals->generatesKeyUp ); XP_ASSERT( globals->generatesKeyUp );
if ( globals->keyDownReceived ) {
globals->keyDownReceived = XP_FALSE;
draw = handleKeyEvent( globals, event, &handled );
}
break;
case keyDownEvent: case keyDownEvent:
if ( !globals->menuIsDown ) { if ( !globals->menuIsDown ) {
globals->keyDownReceived = XP_TRUE;
draw = handleKeyEvent( globals, event, &handled ); draw = handleKeyEvent( globals, event, &handled );
} }
break; break;
@ -3176,8 +3182,9 @@ palmask( PalmAppGlobals* globals, const XP_UCHAR* str, const XP_UCHAR* yesButton
centerControl( form, XW_ASK_YES_BUTTON_ID ); centerControl( form, XW_ASK_YES_BUTTON_ID );
} }
/* This is making me puke.... :-) */ /* If we're running OS5 (oneDotFiveAvail), then eat the first keyDown.
if ( globals->handlingKeyEvent ) { If an earlier OS (Treo600) then we won't see that spurious event. */
if ( globals->handlingKeyEvent && globals->oneDotFiveAvail ) {
globals->ignoreFirstKeyDown = XP_TRUE; globals->ignoreFirstKeyDown = XP_TRUE;
} }

View file

@ -298,6 +298,7 @@ struct PalmAppGlobals {
XP_Bool hasTreoFiveWay; XP_Bool hasTreoFiveWay;
XP_Bool generatesKeyUp; XP_Bool generatesKeyUp;
XP_Bool isZodiac; XP_Bool isZodiac;
XP_Bool keyDownReceived;
/* PalmOS seems pretty broken w.r.t. key events. If I put up a modal /* PalmOS seems pretty broken w.r.t. key events. If I put up a modal
dialog while in the process of handling a keyUp, that form gets a dialog while in the process of handling a keyUp, that form gets a
keyDown (and not with the repeat bit set either.) Hack around it. */ keyDown (and not with the repeat bit set either.) Hack around it. */