2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Force enable fractional-scale-v1 experimental option

This commit is contained in:
Ilya Fedin
2023-11-13 23:29:38 +04:00
committed by John Preston
parent 0f9d83f34b
commit 4696f731da
6 changed files with 30 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/local_url_handlers.h"
#include "core/update_checker.h"
#include "core/deadlock_detector.h"
#include "base/options.h"
#include "base/timer.h"
#include "base/concurrent_timer.h"
#include "base/invoke_queued.h"
@@ -37,6 +38,22 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Core {
namespace {
base::options::toggle OptionForceWaylandFractionalScaling({
.id = kOptionForceWaylandFractionalScaling,
.name = "Force enable fractional-scale-v1",
.description = "Enable fractional-scale-v1 on Wayland without "
"precise High DPI scaling. "
"Requires Qt with Desktop App Toolkit patches.",
.scope = [] {
#ifdef DESKTOP_APP_QT_PATCHED
return Platform::IsWayland();
#else // DESKTOP_APP_QT_PATCHED
return false;
#endif // !DESKTOP_APP_QT_PATCHED
},
.restartRequired = true,
});
QChar _toHex(ushort v) {
v = v & 0x000F;
return QChar::fromLatin1((v >= 10) ? ('a' + (v - 10)) : ('0' + v));
@@ -77,12 +94,17 @@ QString _escapeFrom7bit(const QString &str) {
} // namespace
const char kOptionForceWaylandFractionalScaling[] = "force-wayland-fractional-scaling";
bool Sandbox::QuitOnStartRequested = false;
Sandbox::Sandbox(int &argc, char **argv)
: QApplication(argc, argv)
, _mainThreadId(QThread::currentThreadId()) {
setQuitOnLastWindowClosed(false);
if (OptionForceWaylandFractionalScaling.value()) {
setProperty("_q_force_wayland_fractional_scale", true);
}
}
int Sandbox::start() {

View File

@@ -19,6 +19,8 @@ class QLockFile;
namespace Core {
extern const char kOptionForceWaylandFractionalScaling[];
class UpdateChecker;
class Application;