[Wine-patches] [eter-1.0.12] Revert "user32: Don't call set_active_window from SetFocus (eterbug #4382)". See eterbug #4623.
Alexander Morozov
amorozov на etersoft.ru
Ср Фев 17 14:12:56 MSK 2010
----------- следующая часть -----------
From fd59a6ae302f2bae3b77278522c3cf9599606058 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Tue, 16 Feb 2010 18:06:22 +0300
Subject: [eter-1.0.12] Revert "user32: Don't call set_active_window from SetFocus (eterbug #4382)". See eterbug #4623.
---
dlls/user32/focus.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c
index ffe22cb..707c677 100644
--- a/dlls/user32/focus.c
+++ b/dlls/user32/focus.c
@@ -300,8 +300,15 @@ HWND WINAPI SetFocus( HWND hwnd )
/* call hooks */
if (HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)hwnd, (LPARAM)previous, TRUE )) return 0;
- /* Do not change focus if the window is no longer active */
- if (hwndTop != GetActiveWindow()) return 0;
+ /* activate hwndTop if needed. */
+ if (hwndTop != GetActiveWindow())
+ {
+ 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 longer active */
+ if (hwndTop != GetActiveWindow()) return 0;
+ }
}
else /* NULL hwnd passed in */
{
--
1.6.5.8
Подробная информация о списке рассылки Wine-patches