From 9c7fe328303043309fb1c3de017714945148b15f Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 8 Dec 2021 05:23:40 +0400 Subject: [PATCH] Use winId to get window handle on Windows There's no need to call QPlatformNativeInterface for that --- ui/platform/win/ui_window_win.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ui/platform/win/ui_window_win.cpp b/ui/platform/win/ui_window_win.cpp index b48948e..e4c57e7 100644 --- a/ui/platform/win/ui_window_win.cpp +++ b/ui/platform/win/ui_window_win.cpp @@ -740,16 +740,7 @@ HWND GetWindowHandle(not_null widget) { } HWND GetWindowHandle(not_null window) { - if (!window->winId()) { - window->create(); - } - - const auto native = QGuiApplication::platformNativeInterface(); - Assert(native != nullptr); - - return static_cast(native->nativeResourceForWindow( - QByteArrayLiteral("handle"), - window)); + return static_cast(window->winId()); } void SendWMPaintForce(not_null widget) {