At 12:50 PM 9/15/00 -0400, you wrote:
snip
I have actually looked further at your patch and my first patch is
not correct. In fact, while a 'true' child window can not be made
ws_ex_topmost, a 'child of the desktop' can (useless as it is)
And I failed to notice that the call setting the combolbox topmost
was actually ... Wine internal code :-))
[I don't use +relay in this trace because it change the program
execution in this case; there is no problem if I use relay tracing :-]
I start from there :
hwnd wndPtr queue Class Name StyleWndProc Text
008c 40345b18 0257 #327691600 40ca02bc null
02fc40345d88 0257 TSwatForm 16ca 40ca07a8 L"Swat!"
054040345fcc 0257 TOptionsDlg 86c8 40ca0898 L"Options"
043c40345ec8 0257 TAboutBox 86c8 40ca0820 L"About"
027040345cfc 0257 TPUtilWindow 8400 40ca0730 L""
013040345bbc 0257 TApplication 94ca 40ca06b8 L"Swat!"
Then I open the menu for TSwatForm:
trace:win:WINPOS_WindowFromPoint scope 02fc 293,101
trace:win:WIN_CreateWindowEx # "#32768" 0008 8000 260,103 97x59 02fc
0040 0x234
trace:win:WINPOS_SendNCCalcSize 260,103-357,162
trace:win:WIN_SetWindowLong 644=0x403460d0 0 234 2
trace:win:WIN_CreateWindowEx created window 0644
trace:win:SetWindowPos hwnd 0644, ins swp (0,0)-(0,0) flags 0053
trace:win:SetWindowPos current (260,103)-(357,162), style 8400
warn:win:SWP_DoOwnedPopups (0644) hInsertAfter =
Then I select the menu item for opening TOptionsDlg,
the following code is run (I have added a trace) :
/* find the first non-topmost window */
for (wndTemp = WIN_LockWndPtr(WIN_GetDesktop()-child); wndTemp;
WIN_UpdateWndPtr(wndTemp,wndTemp-next))
{
TRACE("TOP: wnd=%x visible=%s top=%s\n", wndTemp-hwndSelf,
(wndTemp-dwStyle WS_VISIBLE)? "Yes":"No",
(wndTemp-dwExStyle WS_EX_TOPMOST) ? "Yes":"No");
if (!(wndTemp-dwExStyle WS_EX_TOPMOST))
break;
else
{
/* this is a topmost window, place the window after this one */
hwndInsertAfter = wndTemp-hwndSelf;
TRACE("the top window is a topmost window(hwnd=%x,
hwndInsertAfter=%x)\n",
wndPtr-hwndSelf, hwndInsertAfter);
}
}
trace:win:ShowWindow hwnd=0540, cmd=1
trace:win:SetWindowPos hwnd 0540, ins swp (0,0)-(0,0) flags 0063
trace:win:SetWindowPos current (208,183)-(592,416), style 86c8
warn:win:SWP_DoOwnedPopups (0540) hInsertAfter =
trace:win:WINPOS_SendNCCalcSize 208,183-592,416
trace:win:SetWindowPos A non topmost window(hwnd=540) is placed at the top
trace:win:SetWindowPos TOP: wnd=644 visible=No top=Yes
trace:win:SetWindowPos the top window is a topmost window(hwnd=540,
hwndInsertAfter=644)
trace:win:SetWindowPos TOP: wnd=2fc visible=Yes top=No
trace:event:EVENT_ProcessAllEvents called (thread 80c3330).
trace:win:X11DRV_WND_SetZOrder restack 540 over 644
trace:event:EVENT_ProcessAllEvents called (thread 80c3330).
trace:event:EVENT_ProcessAllEvents called (thread 8064b80).
trace:win:WINPOS_SetActiveWindow (0540, 0, 1)
trace:win:SetWindowPos status flags = 1863
trace:event:EVENT_ProcessAllEvents called (thread 80c3330).
trace:event:EVENT_ProcessAllEvents called (thread 8064b80).
trace:win:SetWindowPos hwnd 0540, swp (0,0)-(0,0) flags 0063
trace:win:SetWindowPos hwnd 0540, ins swp (0,0)-(0,0) flags 0003
trace:win:SetWindowPos current (208,183)-(592,416), style 96c8
warn:win:SWP_DoOwnedPopups (0540) hInsertAfter =
trace:win:SetWindowPos A non topmost window(hwnd=540) is placed at the top
trace:win:SetWindowPos TOP: wnd=644 visible=No top=Yes
trace:win:SetWindowPos the top window is a topmost window(hwnd=540,
hwndInsertAfter=644)
trace:win:SetWindowPos TOP: wnd=540 visible=Yes top=No
trace:event:EVENT_ProcessAllEvents called (thread 80c3330).
trace:win:X11DRV_WND_SetZOrder restack 540 over 644
trace:event:EVENT_ProcessAllEvents called (thread 80c3330)
As you can see (I have also added trace in XSetWindowPos),
your last patch is doing restacking with unmapped windows :-)
While it does not crash *my* X server, this kind of call seems
to not produce any effect for me.
In my other failing app, the problem was similar but the app was
trying to set a window before a combolbox (hidden, of course).
The following patch fixes both my failing apps, but is it
correct ? Probably it should be done at the X SetWindowPos
level instead, but I'm not sure, these 'Z-order + visible' problems
are complex :-(
@@ -2737,7 +2737,7 @@
{
if (!(wndTemp-dwExStyle WS_EX_TOPMOST))
break;
- else
+ else if (wndTemp-dwStyle WS_VISIBLE)
{