Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlamar committed Dec 20, 2024
1 parent 0629cc4 commit 881d227
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion kiwix-desktop.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += core gui network
QT += core gui gui-private network
QT += webenginewidgets webchannel
QT += printsupport
qtHaveModule(texttospeech): QT += texttospeech
Expand Down
21 changes: 14 additions & 7 deletions src/kiwixapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
#include <QPrintDialog>
#include <thread>
#include <QMessageBox>
#if defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#if defined(Q_OS_WIN)
#include <QWindow>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtPlatformHeaders\QWindowsWindowFunctions>
#else
#include <qpa/qplatformwindow_p.h>
#endif
#endif

const QString DEFAULT_SAVE_DIR = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
Expand Down Expand Up @@ -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<HWND>(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 = dynamic_cast<QNativeInterface::Private::QWindowsWindow *>(window->nativeInterface());
if (nativeWindow) {
nativeWindow->setHasBorderInFullScreen(true);
}
#endif
}
#endif
connect(this, &QtSingleApplication::messageReceived, this, [=](const QString &message) {
Expand Down

0 comments on commit 881d227

Please sign in to comment.