Skip to content

Commit

Permalink
Merge pull request #1117 from kiwix/qt_6.7
Browse files Browse the repository at this point in the history
Do not use removed `setHasBorderInFullScreen` with qt >= 6.0
  • Loading branch information
kelson42 committed May 27, 2024
2 parents 78cfc4c + 456c58b commit e3745f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/kiwixapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit e3745f0

Please sign in to comment.