Piotr Caban : user32: Change SetFocus behavior on windows with parent and no WS_CHILD flag.
Alexandre Julliard
julliard at winehq.org
Wed Mar 26 14:34:13 CDT 2014
Module: wine
Branch: master
Commit: 1cf3d8caa4df59490343ef9427ea5c6bc2af44c9
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1cf3d8caa4df59490343ef9427ea5c6bc2af44c9
Author: Piotr Caban <piotr at codeweavers.com>
Date: Wed Mar 26 12:54:38 2014 +0100
user32: Change SetFocus behavior on windows with parent and no WS_CHILD flag.
---
dlls/user32/focus.c | 1 +
dlls/user32/tests/win.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c
index bd2e572..c47a82d 100644
--- a/dlls/user32/focus.c
+++ b/dlls/user32/focus.c
@@ -277,6 +277,7 @@ HWND WINAPI SetFocus( HWND hwnd )
HWND parent;
LONG style = GetWindowLongW( hwndTop, GWL_STYLE );
if (style & (WS_MINIMIZE | WS_DISABLED)) return 0;
+ if (!(style & WS_CHILD)) break;
parent = GetAncestor( hwndTop, GA_PARENT );
if (!parent || parent == GetDesktopWindow())
{
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index f8c919a..cb74b8e 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -3724,6 +3724,25 @@ todo_wine
check_active_state(popup, 0, popup);
SetActiveWindow(parent);
+ SetFocus(popup);
+ check_active_state(popup, 0, popup);
+
+ EnableWindow(child1, FALSE);
+ check_active_state(popup, 0, popup);
+ SetFocus(parent);
+ check_active_state(parent, 0, parent);
+ SetFocus(popup);
+ check_active_state(popup, 0, popup);
+ EnableWindow(child1, TRUE);
+
+ ShowWindow(child1, SW_MINIMIZE);
+ SetFocus(parent);
+ check_active_state(parent, 0, parent);
+ SetFocus(popup);
+ check_active_state(popup, 0, popup);
+ ShowWindow(child1, SW_HIDE);
+
+ SetActiveWindow(parent);
SetFocus(parent);
check_active_state(parent, 0, parent);
More information about the wine-cvs
mailing list