mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
Send message on back key only when coming up, not going down, to
prevent double-dismiss of dialogs.
This commit is contained in:
parent
c81e85deef
commit
bff5f9b7c9
3 changed files with 7 additions and 5 deletions
|
@ -2397,7 +2397,7 @@ WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
exits the app. Bad. So we'll only raise if the
|
||||
first was not handled. Note that this may well break
|
||||
on devices I haven't tested on, later, whenever. */
|
||||
&& (0 == (0x1000 & LOWORD(lParam))) ) {
|
||||
&& (0 == (BACK_KEY_UP_MAYBE & LOWORD(lParam))) ) {
|
||||
XP_LOGF( "calling ceSaveAndExit for VK_TBACK" );
|
||||
/* I'm actually exiting the app rather than minimize. As
|
||||
it stands, minimizing means that even if I relaunch
|
||||
|
|
|
@ -190,4 +190,6 @@ XP_Bool queryBoxChar( CEAppGlobals* globals, const XP_UCHAR* msg );
|
|||
(IS_SMARTPHONE(g)?LB_FINDSTRINGEXACT:CB_FINDSTRINGEXACT)
|
||||
#define LB_IF_PPC(g,id) (IS_SMARTPHONE(g)?id:(id+2))
|
||||
|
||||
|
||||
#define BACK_KEY_UP_MAYBE 0x1000
|
||||
#endif /* _CEMAIN_H_ */
|
||||
|
|
|
@ -407,7 +407,7 @@ ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId )
|
|||
}
|
||||
|
||||
static XP_Bool
|
||||
editHasFocus( const CeDlgHdr* dlgHdr )
|
||||
editHasFocus( void )
|
||||
{
|
||||
HWND focus = GetFocus();
|
||||
wchar_t buf[32];
|
||||
|
@ -426,14 +426,14 @@ ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam )
|
|||
#ifdef OVERRIDE_BACKKEY
|
||||
case WM_HOTKEY:
|
||||
if ( VK_TBACK == HIWORD(lParam) ) {
|
||||
if ( editHasFocus( dlgHdr ) ) {
|
||||
if ( editHasFocus() ) {
|
||||
SHSendBackToFocusWindow( message, wParam, lParam );
|
||||
handled = TRUE;
|
||||
} else {
|
||||
} else if ( 0 != (BACK_KEY_UP_MAYBE & LOWORD(lParam) ) ) {
|
||||
WPARAM cmd = (0 != (dlgHdr->doWhat & DLG_STATE_DONEONLY)) ?
|
||||
IDOK : IDCANCEL;
|
||||
SendMessage( dlgHdr->hDlg, WM_COMMAND, cmd, 0L );
|
||||
}
|
||||
handled = TRUE;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue