"Anatoly Lyutin" vostok@etersoft.ru wrote:
I try to make this test (in test_ShowWindow : "/* 32 */ { SW_HIDE, TRUE, 0, WmHide_3, TRUE }, ") passes clear and after some changes I observe that SetFocus() is working strange for some case. After this I wrote a test case for SetFocus(). SetFocus() have one incorrect behavior for working of combination ( visible-invisible parent or child).
The test actually doesn't do anything useful. It doesn't check any focus windows and many vital message parameters. Besides we already have test_SetFocus() in win.c.
Dmitry Timoshkov wrote:
The test actually doesn't do anything useful. It doesn't check any focus windows
Hmm, I can to fix it.
and many vital message parameters.
Example?
Besides we already have test_SetFocus() in win.c.
Yes, I have seen this but this test does not show issue that I have found. I have written this test for one purpose : I can not understand in which cases sets hooks HCBT_SETFOCUS and HCBT_ACTIVATE for there combinations of visible/invisible windows.
Also it will be nice if somebody says how I can make this test well and useful.
"Anatoly Lyutin" vostok@etersoft.ru wrote:
The test actually doesn't do anything useful. It doesn't check any focus windows
Hmm, I can to fix it.
and many vital message parameters.
Example?
WM_ACTIVATEAPP, WM_NCACTIVATE, WM_ACTIVATE.
Besides we already have test_SetFocus() in win.c.
Yes, I have seen this but this test does not show issue that I have found. I have written this test for one purpose : I can not understand in which cases sets hooks HCBT_SETFOCUS and HCBT_ACTIVATE for there combinations of visible/invisible windows.
It doesn't matter for a hook if a window is visible or not, so the behaviour you are trying to figure out is not useful for a test IMO.
Dmitry Timoshkov wrote:
Example?
WM_ACTIVATEAPP, WM_NCACTIVATE, WM_ACTIVATE.
I shall see this..
It doesn't matter for a hook if a window is visible or not,
How I can see from this test - it is matter:
/* SetFocus( hwnd ) Invisible parent, visible child */ static const struct message SetFocusSeq_5[] = { { HCBT_SETFOCUS, hook }, { HCBT_ACTIVATE, hook }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
...
and
/* SetFocus( hwnd ) Invisible parent, invisible child */ static const struct message SetFocusSeq_8[] = { { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
Am I wrong?
I know a little about hooks :(.
so the behaviour you are trying to figure out is not useful for a test IMO.
It may to be true, but I have seen a difference from message sequences in Windows and Wine. Only this have motivated me to post this test in wine-patches list.
"Anatoly Lyutin" vostok@etersoft.ru wrote:
It doesn't matter for a hook if a window is visible or not,
How I can see from this test - it is matter:
/* SetFocus( hwnd ) Invisible parent, visible child */ static const struct message SetFocusSeq_5[] = { { HCBT_SETFOCUS, hook }, { HCBT_ACTIVATE, hook }, { WM_WINDOWPOSCHANGING, sent|wparam, SWP_NOSIZE|SWP_NOMOVE },
...
and
/* SetFocus( hwnd ) Invisible parent, invisible child */ static const struct message SetFocusSeq_8[] = { { HCBT_SETFOCUS, hook }, { WM_IME_SETCONTEXT, sent|wparam|optional, 1 },
Am I wrong?
I know a little about hooks :(.
Looks like you need a test for window activation, not focus or hooks. You may try to add some missing bits to win.c,test_SetActiveWindow().
so the behaviour you are trying to figure out is not useful for a test IMO.
It may to be true, but I have seen a difference from message sequences in Windows and Wine. Only this have motivated me to post this test in wine-patches list.
Are you trying to fix a bug?
Dmitry Timoshkov wrote:
Looks like you need a test for window activation, not focus or hooks. You may try to add some missing bits to win.c,test_SetActiveWindow().
May be.. I decide to test SetFocus() because in this function calls set_active_window() and another case set_active_window() not calls. I try to understand how SetFocus() works..
Are you trying to fix a bug?
No. I have written in the first letter with test: I try to make "test_ShowWindow : "/* 32 */ { SW_HIDE, TRUE, 0, WmHide_3, TRUE },
passes clear. And I found that it falls because HCBT_SETFOCUS not set for this window after WM_WINDOWPOSCHANGING and if I put a SetFocus(hwnd) in static BOOL show_window( HWND hwnd, INT cmd ) { ... if (cmd == SW_HIDE) { ... /* Revert focus to parent */ hFocus = GetFocus(); if (hwnd == hFocus || IsChild(hwnd, hFocus)) { HWND parent = GetAncestor(hwnd, GA_PARENT); if (parent == GetDesktopWindow()) parent = 0; SetFocus(parent); }
to this -> SetFocus(hwnd); // naturally this is a very bad hack, but I only search working of show_window() or SetFocus(GetAncestor(hwnd, GA_ROOT)); this hook will be set and broke working of another test, but in another cases such us : SetFocus( GetAncestor(hwnd, GA_PARENT)); or SetFocus(0); this hook not set. // nothing to strange of cause..
.. }
I try to catch issue why in another test hook sets well and why in this test hook is not sets.