Possible fix for #6

This commit is contained in:
nathan 2018-04-08 22:22:30 +02:00
parent 2b24e8c9cb
commit 09f9a1e614
1 changed files with 7 additions and 5 deletions

View File

@ -161,8 +161,9 @@ class GtkTheme {
}
});
// fallback
if (screenDPI.get() == 0) {
if (screenDPI.get() <= 0) {
// GET THE DPI IN LINUX
// https://wiki.archlinux.org/index.php/Talk:GNOME
Object detectedValue = Toolkit.getDefaultToolkit().getDesktopProperty("gnome.Xft/DPI");
@ -171,13 +172,14 @@ class GtkTheme {
if (dpi == -1) {
screenDPI.set((int) defaultDPI);
}
if (dpi < 50) {
// 50 dpi is the minimum value gnome allows
screenDPI.set(50);
}
}
}
// 50 dpi is the minimum value gnome allows, and assume something screwed up. We apply this for ALL environments!
if (screenDPI.get() < 50) {
screenDPI.set((int) defaultDPI);
}
// check system ENV variables.
if (screenScale.get() == 0) {