Author: jimtabor Date: Fri Feb 6 20:57:45 2015 New Revision: 66182
URL: http://svn.reactos.org/svn/reactos?rev=66182&view=rev Log: [User32] - Patch by Piotr Caban : Only store dialog focus when window is hidden or inactive. Only use DIALOGINFO-> hwndFocus to store last focus of inactive windows.
Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c
Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/windows... ============================================================================== --- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Fri Feb 6 20:57:45 2015 @@ -802,8 +802,7 @@ else DEFDLG_SetFocus( infoPtr->hwndFocus );
- /* This used to set infoPtr->hwndFocus to NULL for no apparent reason, - sometimes losing focus when receiving WM_SETFOCUS messages. */ + infoPtr->hwndFocus = NULL; }
/*********************************************************************** @@ -1047,13 +1046,14 @@ /* By returning TRUE, app has requested a default focus assignment. * WM_INITDIALOG may have changed the tab order, so find the first * tabstop control again. */ - dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE ); - if (!dlgInfo->hwndFocus) dlgInfo->hwndFocus = GetNextDlgGroupItem( hwnd, 0, FALSE ); - if( dlgInfo->hwndFocus ) - SetFocus( dlgInfo->hwndFocus ); + focus = GetNextDlgTabItem( hwnd, 0, FALSE ); + if (!focus) focus = GetNextDlgGroupItem( hwnd, 0, FALSE ); + if (focus) + SetFocus( focus ); } -//// ReactOS - DEFDLG_SaveFocus( hwnd ); +//// ReactOS see 43396, Fixes setting focus on Open and Close dialogs to the FileName edit control in OpenOffice. +//// This now breaks test_SaveRestoreFocus. + //DEFDLG_SaveFocus( hwnd ); //// } //// ReactOS Rev 30613 & 30644