changeset 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 0f9c6f7636db
children 91bdd9840b9f
files os2/dw.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
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;
 }