Don't use QPlatformNativeInterface for native window handle on Windows

This commit is contained in:
Ilya Fedin 2021-12-08 05:31:53 +04:00 committed by John Preston
parent 33b7ac209e
commit 48ab88a9ca
2 changed files with 1 additions and 7 deletions

View File

@ -32,7 +32,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtWidgets/QApplication>
#include <QtGui/QWindow>
#include <QtGui/QScreen>
#include <qpa/qplatformnativeinterface.h>
#include <Shobjidl.h>
#include <shellapi.h>
@ -429,11 +428,7 @@ void MainWindow::updateIconCounters() {
}
void MainWindow::initHook() {
if (const auto native = QGuiApplication::platformNativeInterface()) {
ps_hWnd = static_cast<HWND>(native->nativeResourceForWindow(
QByteArrayLiteral("handle"),
windowHandle()));
}
ps_hWnd = static_cast<HWND>(winId());
if (!ps_hWnd) {
return;
}

View File

@ -31,7 +31,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtWidgets/QDesktopWidget>
#include <QtGui/QDesktopServices>
#include <QtGui/QWindow>
#include <qpa/qplatformnativeinterface.h>
#include <Shobjidl.h>
#include <ShObjIdl_core.h>