# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1348731030 0 # Node ID 5ed9f7ea388257141b3cd8ce090d91f0410fa0c4 # Parent aedf5903db0a32ae470dd9e693403d07c4667634 Make sure _toplevel_window() when passed a top-level window returns itself on Windows. diff -r aedf5903db0a -r 5ed9f7ea3882 win/dw.c --- a/win/dw.c Thu Sep 27 05:09:10 2012 +0000 +++ b/win/dw.c Thu Sep 27 07:30:30 2012 +0000 @@ -1249,6 +1249,9 @@ { HWND box, lastbox = GetParent(handle); + if(!lastbox) + lastbox = handle; + /* Find the toplevel window */ while((box = GetParent(lastbox))) {