Mercurial > dwindows
comparison win/dw.c @ 1803:5ed9f7ea3882
Make sure _toplevel_window() when passed a top-level window
returns itself on Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 27 Sep 2012 07:30:30 +0000 |
parents | 165f6ffa8176 |
children | 83b2bd4ca2a3 |
comparison
equal
deleted
inserted
replaced
1802:aedf5903db0a | 1803:5ed9f7ea3882 |
---|---|
1247 | 1247 |
1248 HWND _toplevel_window(HWND handle) | 1248 HWND _toplevel_window(HWND handle) |
1249 { | 1249 { |
1250 HWND box, lastbox = GetParent(handle); | 1250 HWND box, lastbox = GetParent(handle); |
1251 | 1251 |
1252 if(!lastbox) | |
1253 lastbox = handle; | |
1254 | |
1252 /* Find the toplevel window */ | 1255 /* Find the toplevel window */ |
1253 while((box = GetParent(lastbox))) | 1256 while((box = GetParent(lastbox))) |
1254 { | 1257 { |
1255 /* If it hasn't been packed yet.. */ | 1258 /* If it hasn't been packed yet.. */ |
1256 if(box == DW_HWND_OBJECT) | 1259 if(box == DW_HWND_OBJECT) |