From 02c1f4e9165084589941ce205defaf5f3f1ea90f Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Wed, 24 Jun 2020 11:14:27 +0200 Subject: toplevel: fix finding ancestor when passing a child as owner --- alf/alftoplevel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alf/alftoplevel.cpp b/alf/alftoplevel.cpp index 0747ea2..23d2da3 100644 --- a/alf/alftoplevel.cpp +++ b/alf/alftoplevel.cpp @@ -473,7 +473,7 @@ ALF_CreateToplevelWindow(DWORD exstyle, DWORD style, HWND hwndOwner, ALFApplicat if (hwndOwner == GetDesktopWindow()) hwndOwner = NULL; - if (hwndOwner && GetWindowLong(hwndOwner, GWL_STYLE) & WS_CHILD) + while (hwndOwner && GetWindowLong(hwndOwner, GWL_STYLE) & WS_CHILD) hwndOwner = GetParent(hwndOwner); // copy app of owner, but only if we're in the same thread -- cgit v1.2.3