Merge pull request #1117 from kiwix/qt_6.7

Do not use removed `setHasBorderInFullScreen` with qt >= 6.0
This commit is contained in:
Kelson 2024-05-27 15:57:39 +02:00 committed by GitHub
commit e3745f0113
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,7 @@
#include <QPrintDialog>
#include <thread>
#include <QMessageBox>
#ifdef Q_OS_WIN
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtPlatformHeaders\QWindowsWindowFunctions>
#endif
@ -96,7 +96,12 @@ void KiwixApp::init()
#ifdef Q_OS_WIN
QWindow *window = mp_mainWindow->windowHandle();
if (window) {
QWindowsWindowFunctions::setHasBorderInFullScreen(window, true);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QWindowsWindowFunctions::setHasBorderInFullScreen(window, true);
#else
HWND handle = reinterpret_cast<HWND>(window->winId());
SetWindowLongPtr(handle, GWL_STYLE, GetWindowLongPtr(handle, GWL_STYLE) | WS_BORDER);
#endif
}
#endif
connect(this, &QtSingleApplication::messageReceived, this, [=](const QString &message) {