Windows QPA: Fix QGuiApplication::topLevelAt() with screen recorder applications
Special applications like screen recorders can create special, invisible windows which are detected by the ChildWindowFromPointEx() as used in QWindowsContext::findPlatformWindowAt(). Fall back to WindowFromPoint() which skips those in case nothing is found. Fixes: QTBUG-40815 Change-Id: Idb5253c412fb4522c844edf5eadedc6e0fad3979 Reviewed-by: André de la Rocha <andre.rocha@qt.io>
parent
978987981a
commit
0f417efe0f
|
|
@ -749,6 +749,12 @@ QWindowsWindow *QWindowsContext::findPlatformWindowAt(HWND parent,
|
|||
QWindowsWindow *result = nullptr;
|
||||
const POINT screenPoint = { screenPointIn.x(), screenPointIn.y() };
|
||||
while (findPlatformWindowHelper(screenPoint, cwex_flags, this, &parent, &result)) {}
|
||||
// QTBUG-40815: ChildWindowFromPointEx() can hit on special windows from
|
||||
// screen recorder applications like ScreenToGif. Fall back to WindowFromPoint().
|
||||
if (result == nullptr) {
|
||||
if (const HWND window = WindowFromPoint(screenPoint))
|
||||
result = findPlatformWindow(window);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue