Mercurial > dwindows
diff os2/dw.c @ 1466:65986481a3d8
Rewrote _toplevel_window() on OS/2 so it is more accurate...
Should allow packing boxes that aren't already packed again.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 18 Dec 2011 11:34:41 +0000 |
parents | 98de42fc664d |
children | 1794caee0758 |
line wrap: on
line diff
--- a/os2/dw.c Sat Dec 17 22:37:36 2011 +0000 +++ b/os2/dw.c Sun Dec 18 11:34:41 2011 +0000 @@ -254,13 +254,19 @@ HWND box, lastbox = WinQueryWindow(handle, QW_PARENT); /* Find the toplevel window */ - while((box = WinQueryWindow(lastbox, QW_PARENT)) != desktop && box > 0) + while((box = WinQueryWindow(lastbox, QW_PARENT)) != desktop && box) { lastbox = box; } - if(box > 0) - return lastbox; - return handle; + if(box) + { + char tmpbuf[100] = {0}; + + WinQueryClassName(lastbox, 99, (PCH)tmpbuf); + if(strncmp(tmpbuf, "#1", 3) == 0) + return lastbox; + } + return NULLHANDLE; }