[PATCH 2/2] user32: Don't release capture of child window when disabling parent window.(try 4)
Guo Jian
orzhvs at gmail.com
Sun May 19 02:07:20 CDT 2013
Fixing bug http://bugs.winehq.org/show_bug.cgi?id=33542
---
dlls/user32/tests/win.c | 4 ++--
dlls/user32/win.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 2836882..fb32054 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -2987,13 +2987,13 @@ static void test_capture_3(HWND hwnd1, HWND hwnd2)
ret = ReleaseCapture();
ok (ret, "releasecapture did not return TRUE after second try.\n");
- child = CreateWindowExA( 0, "button", NULL, WS_CHILD, 0, 0, 0, 0, hwnd1, 0, 0, NULL );
+ child = CreateWindowExA(0, "button", NULL, WS_CHILD, 0, 0, 0, 0, hwnd1, 0, 0, NULL);
assert(child);
SetCapture(child);
check_wnd_state(hwnd1, hwnd1, hwnd1, child);
EnableWindow(hwnd1, FALSE);
- todo_wine ok(GetCapture() != NULL, "capture in child window should not be released.\n");
+ ok(GetCapture() != NULL, "capture in child window should not be released.\n");
EnableWindow(hwnd1, TRUE);
DestroyWindow(child);
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index db4881a..5c82f54 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -2125,7 +2125,7 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable )
SetFocus( 0 ); /* A disabled window can't have the focus */
capture_wnd = GetCapture();
- if (hwnd == capture_wnd || IsChild(hwnd, capture_wnd))
+ if (hwnd == capture_wnd)
ReleaseCapture(); /* A disabled window can't capture the mouse */
SendMessageW( hwnd, WM_ENABLE, FALSE, 0 );
--
1.8.1.5
More information about the wine-patches
mailing list