mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-08-03 20:56:49 -04:00
Disable sandbox when run from Windows shared drive
This commit is contained in:
parent
e5563dc645
commit
6f9d01a282
13
src/main.cpp
13
src/main.cpp
@ -5,6 +5,10 @@
|
|||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
#include <kiwix/tools.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
|
||||||
#include <QWebEngineUrlScheme>
|
#include <QWebEngineUrlScheme>
|
||||||
#endif
|
#endif
|
||||||
@ -18,6 +22,15 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
// End of hack ^^^
|
// End of hack ^^^
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
std::string driveLetter = kiwix::getExecutablePath().substr(0, 3);
|
||||||
|
qInfo() << driverLetter;
|
||||||
|
UINT driveType = GetDriveTypeA(driveLetter.c_str());
|
||||||
|
if(driveType == DRIVE_REMOTE) {
|
||||||
|
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", QByteArray("--no-sandbox"));
|
||||||
|
qInfo() << "Disabled sandbox";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
// High DPI Scaling is enabled by default in Qt6. This attribute no longer exists in 6.0 and later
|
// High DPI Scaling is enabled by default in Qt6. This attribute no longer exists in 6.0 and later
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user