Don't use QPlatformNativeInterface for native window handle on Windows
This commit is contained in:
parent
33b7ac209e
commit
48ab88a9ca
|
@ -32,7 +32,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <QtGui/QScreen>
|
#include <QtGui/QScreen>
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
|
||||||
|
|
||||||
#include <Shobjidl.h>
|
#include <Shobjidl.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
|
@ -429,11 +428,7 @@ void MainWindow::updateIconCounters() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::initHook() {
|
void MainWindow::initHook() {
|
||||||
if (const auto native = QGuiApplication::platformNativeInterface()) {
|
ps_hWnd = static_cast<HWND>(winId());
|
||||||
ps_hWnd = static_cast<HWND>(native->nativeResourceForWindow(
|
|
||||||
QByteArrayLiteral("handle"),
|
|
||||||
windowHandle()));
|
|
||||||
}
|
|
||||||
if (!ps_hWnd) {
|
if (!ps_hWnd) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QtWidgets/QDesktopWidget>
|
#include <QtWidgets/QDesktopWidget>
|
||||||
#include <QtGui/QDesktopServices>
|
#include <QtGui/QDesktopServices>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
|
||||||
|
|
||||||
#include <Shobjidl.h>
|
#include <Shobjidl.h>
|
||||||
#include <ShObjIdl_core.h>
|
#include <ShObjIdl_core.h>
|
||||||
|
|
Loading…
Reference in New Issue