diff --git a/kiwix-desktop.pro b/kiwix-desktop.pro index 166f312..c1f4f93 100644 --- a/kiwix-desktop.pro +++ b/kiwix-desktop.pro @@ -9,6 +9,10 @@ QT += webenginewidgets webchannel QT += printsupport qtHaveModule(texttospeech): QT += texttospeech +win32 { + QT += gui-private +} + # Avoid stripping incompatible files, due to false identification as executables, on WSL DETECT_WSL = $$system(test -f /proc/sys/fs/binfmt_misc/WSLInterop && echo true || echo false) equals(DETECT_WSL , "true"): CONFIG += nostrip diff --git a/src/kiwixapp.cpp b/src/kiwixapp.cpp index f6bad35..c11dca1 100644 --- a/src/kiwixapp.cpp +++ b/src/kiwixapp.cpp @@ -15,8 +15,13 @@ #include #include #include -#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if defined(Q_OS_WIN) +#include +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include +#else +#include +#endif #endif const QString DEFAULT_SAVE_DIR = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); @@ -95,12 +100,14 @@ void KiwixApp::init() #ifdef Q_OS_WIN QWindow *window = mp_mainWindow->windowHandle(); if (window) { - #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) - QWindowsWindowFunctions::setHasBorderInFullScreen(window, true); - #else - HWND handle = reinterpret_cast(window->winId()); - SetWindowLongPtr(handle, GWL_STYLE, GetWindowLongPtr(handle, GWL_STYLE) | WS_BORDER); - #endif +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QWindowsWindowFunctions::setHasBorderInFullScreen(window, true); +#else + auto nativeWindow = window->nativeInterface(); + if (nativeWindow) { + nativeWindow->setHasBorderInFullScreen(true); + } +#endif } #endif connect(this, &QtSingleApplication::messageReceived, this, [=](const QString &message) {