linux: Make scale factor default to 1
This commit is contained in:
parent
779e5c2ea5
commit
f6ff97cbeb
1 changed files with 16 additions and 13 deletions
|
@ -14,11 +14,9 @@ namespace atom {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const char* kInterfaceSchema = "org.gnome.desktop.interface";
|
const char* kInterfaceSchema = "org.gnome.desktop.interface";
|
||||||
const char* kScaleFactor = "scale-factor";
|
const char* kScaleFactor = "scaling-factor";
|
||||||
|
|
||||||
} // namespace
|
void GetDPIFromGSettings(guint* scale_factor) {
|
||||||
|
|
||||||
void AtomBrowserMainParts::SetDPIFromGSettings() {
|
|
||||||
LibGioLoader libgio_loader;
|
LibGioLoader libgio_loader;
|
||||||
|
|
||||||
// Try also without .0 at the end; on some systems this may be required.
|
// Try also without .0 at the end; on some systems this may be required.
|
||||||
|
@ -47,18 +45,23 @@ void AtomBrowserMainParts::SetDPIFromGSettings() {
|
||||||
break;
|
break;
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
|
if (*iter)
|
||||||
if (*iter) {
|
*scale_factor = libgio_loader.g_settings_get_uint(client, kScaleFactor);
|
||||||
guint scale_factor = libgio_loader.g_settings_get_uint(
|
|
||||||
client, kScaleFactor);
|
|
||||||
if (scale_factor >= 1) {
|
|
||||||
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
|
|
||||||
switches::kForceDeviceScaleFactor, base::UintToString(scale_factor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_strfreev(keys);
|
g_strfreev(keys);
|
||||||
g_object_unref(client);
|
g_object_unref(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
void AtomBrowserMainParts::SetDPIFromGSettings() {
|
||||||
|
guint scale_factor = 1;
|
||||||
|
GetDPIFromGSettings(&scale_factor);
|
||||||
|
if (scale_factor == 0)
|
||||||
|
scale_factor = 1;
|
||||||
|
|
||||||
|
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
|
||||||
|
switches::kForceDeviceScaleFactor, base::UintToString(scale_factor));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue