user32: Do not change focus if the window is no more active.
dmitry at codeweavers.com
Tue Nov 18 23:52:36 CST 2008
This patch fixes the problem in the application I'm working on.
The application prevents deactivation of one of its windows, and this
doesn't work without this patch.
dlls/user32/focus.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c
index 3253a87..0924743 100644
@@ -276,6 +276,9 @@ HWND WINAPI SetFocus( HWND hwnd )
if (!set_active_window( hwndTop, NULL, FALSE, FALSE )) return 0;
if (!IsWindow( hwnd )) return 0; /* Abort if window destroyed */
+ /* Do not change focus if the window is no more active */
+ if (hwndTop != GetActiveWindow()) return 0;
else /* NULL hwnd passed in */
More information about the wine-patches