Fix for focus problem in cursor.exe

Joshua Thielen thielen at
Mon Oct 22 22:11:20 CDT 2001

This time with the attachment, oops :)

This patch fixes a focus problem in cursor.exe. cursor.ese handles the 
WM_ACTIVATE message and since it does not call DefWindowProc when 
messages are handled, GetFocus is not called as it normally is in 
DefWndProc. Since no window (or the desktop window) has the focus, 
PERQDATA_GetFocusWnd will return 0 and the focus will not be switched in 
WINPOS_SetActiveWindow. This patch fixes the behavior so that the focus 
will still be switched to the activated window even if the 
PERQDATA_GetFocusWnd returns 0.

modified files:

change log:
Switch focus to activated window even if no window previously had the 

Joshua Thielen
thielen at

-------------- next part --------------
Index: wine/windows/winpos.c
RCS file: /home/wine/wine/windows/winpos.c,v
retrieving revision 1.124
diff -u -r1.124 winpos.c
--- wine/windows/winpos.c	2001/10/17 19:35:36	1.124
+++ wine/windows/winpos.c	2001/10/23 01:12:42
@@ -1361,7 +1361,7 @@
             HWND hOldFocus = PERQDATA_GetFocusWnd( pNewActiveQueue->pQData );
-            if ( hOldFocus && GetAncestor( hOldFocus, GA_ROOT ) != hwndActive )
+            if ( GetAncestor( hOldFocus, GA_ROOT ) != hwndActive )
                 FOCUS_SwitchFocus( pNewActiveQueue, hOldFocus, 
                                    (wndPtr && (wndPtr->dwStyle & WS_MINIMIZE))?
                                    0 : hwndActive );

More information about the wine-patches mailing list