Details
-
Bug
-
Status: Closed
-
P2: Important
-
Resolution: Done
-
5.15.5
-
None
-
-
cb51ab41e8 (qt/qtbase/dev) cb51ab41e8 (qt/tqtc-qtbase/dev) 85d22b0c61 (qt/tqtc-qtbase/6.2) c241a206df (qt/qtbase/6.3) c241a206df (qt/tqtc-qtbase/6.3) c8cdc3eb96 (qt/qtbase/6.4) c8cdc3eb96 (qt/tqtc-qtbase/6.4) 964ba25ff8 (qt/tqtc-qtbase/5.15)
Description
\qtbase\src\plugins\platforms\windows\qwindowscontext.cpp
There is this line of code that causes an infinite loop if "parent"is not updated.
while (findPlatformWindowHelper(screenPoint, cwex_flags, this, &parent, &result)) {}
This is what happens if the line:
const HWND nonTransparentChild = ChildWindowFromPointEx(*hwnd, point, cwexFlags | CWP_SKIPTRANSPARENT);
returns 'nonTransparentChild' == *hwnd
(that is, the function returns the parent, and not null, and not a child. This is legal, according to the Microsoft ChildWindowFromPointEx description).
I have a case where this happens: the top-level window is a transparent window.
Possible solution that works for me: changing:
*result = nonTransparentWindow; *hwnd = nonTransparentChild;
To
*result = nonTransparentWindow; if (*hwnd == nonTransparentChild) return false; *hwnd = nonTransparentChild;