Use winId to get window handle on Windows

There's no need to call QPlatformNativeInterface for that
This commit is contained in:
Ilya Fedin 2021-12-08 05:23:40 +04:00 committed by John Preston
parent 6ac846adbb
commit 9c7fe32830

View file

@ -740,16 +740,7 @@ HWND GetWindowHandle(not_null<QWidget*> widget) {
}
HWND GetWindowHandle(not_null<QWindow*> window) {
if (!window->winId()) {
window->create();
}
const auto native = QGuiApplication::platformNativeInterface();
Assert(native != nullptr);
return static_cast<HWND>(native->nativeResourceForWindow(
QByteArrayLiteral("handle"),
window));
return static_cast<HWND>(window->winId());
}
void SendWMPaintForce(not_null<QWidget*> widget) {