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:
@@ -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() {
|
||||
|
@@ -19,6 +19,8 @@ class QLockFile;
|
||||
|
||||
namespace Core {
|
||||
|
||||
extern const char kOptionForceWaylandFractionalScaling[];
|
||||
|
||||
class UpdateChecker;
|
||||
class Application;
|
||||
|
||||
|
Reference in New Issue
Block a user