mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +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
|
exits the app. Bad. So we'll only raise if the
|
||||||
first was not handled. Note that this may well break
|
first was not handled. Note that this may well break
|
||||||
on devices I haven't tested on, later, whenever. */
|
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" );
|
XP_LOGF( "calling ceSaveAndExit for VK_TBACK" );
|
||||||
/* I'm actually exiting the app rather than minimize. As
|
/* I'm actually exiting the app rather than minimize. As
|
||||||
it stands, minimizing means that even if I relaunch
|
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)
|
(IS_SMARTPHONE(g)?LB_FINDSTRINGEXACT:CB_FINDSTRINGEXACT)
|
||||||
#define LB_IF_PPC(g,id) (IS_SMARTPHONE(g)?id:(id+2))
|
#define LB_IF_PPC(g,id) (IS_SMARTPHONE(g)?id:(id+2))
|
||||||
|
|
||||||
|
|
||||||
|
#define BACK_KEY_UP_MAYBE 0x1000
|
||||||
#endif /* _CEMAIN_H_ */
|
#endif /* _CEMAIN_H_ */
|
||||||
|
|
|
@ -407,7 +407,7 @@ ceDlgComboShowHide( CeDlgHdr* dlgHdr, XP_U16 baseId )
|
||||||
}
|
}
|
||||||
|
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
editHasFocus( const CeDlgHdr* dlgHdr )
|
editHasFocus( void )
|
||||||
{
|
{
|
||||||
HWND focus = GetFocus();
|
HWND focus = GetFocus();
|
||||||
wchar_t buf[32];
|
wchar_t buf[32];
|
||||||
|
@ -426,14 +426,14 @@ ceDoDlgHandle( CeDlgHdr* dlgHdr, UINT message, WPARAM wParam, LPARAM lParam )
|
||||||
#ifdef OVERRIDE_BACKKEY
|
#ifdef OVERRIDE_BACKKEY
|
||||||
case WM_HOTKEY:
|
case WM_HOTKEY:
|
||||||
if ( VK_TBACK == HIWORD(lParam) ) {
|
if ( VK_TBACK == HIWORD(lParam) ) {
|
||||||
if ( editHasFocus( dlgHdr ) ) {
|
if ( editHasFocus() ) {
|
||||||
SHSendBackToFocusWindow( message, wParam, lParam );
|
SHSendBackToFocusWindow( message, wParam, lParam );
|
||||||
handled = TRUE;
|
} else if ( 0 != (BACK_KEY_UP_MAYBE & LOWORD(lParam) ) ) {
|
||||||
} else {
|
|
||||||
WPARAM cmd = (0 != (dlgHdr->doWhat & DLG_STATE_DONEONLY)) ?
|
WPARAM cmd = (0 != (dlgHdr->doWhat & DLG_STATE_DONEONLY)) ?
|
||||||
IDOK : IDCANCEL;
|
IDOK : IDCANCEL;
|
||||||
SendMessage( dlgHdr->hDlg, WM_COMMAND, cmd, 0L );
|
SendMessage( dlgHdr->hDlg, WM_COMMAND, cmd, 0L );
|
||||||
}
|
}
|
||||||
|
handled = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue