Skip to content

Commit

Permalink
Settings: Further improve DPI handling for GTK.
Browse files Browse the repository at this point in the history
  • Loading branch information
waddlesplash committed Jul 20, 2022
1 parent 50967c6 commit bb50047
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions xlib/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ _x_handle_get_settings(Display* dpy, Window w,
const float scaling = (be_plain_font->Size() / 12.0f);
settings.AddInteger("Xft/DPI", scaling * 96 * 1024);
if (scaling >= 2) {
// Unfortunately, fractional provided by Xft/DPI does not work so well
// for GDK, but it cannot be used in combination with integer scaling.
// If we have an integer scaling factor, make use of it.
settings.AddInteger("Gdk/WindowScalingFactor", scaling);
settings.AddInteger("Gdk/UnscaledDPI", 96 * 1024);
settings.AddInteger("Gdk/UnscaledDPI", (scaling - int32(scaling - 1)) * 96 * 1024);
}
}

Expand Down

0 comments on commit bb50047

Please sign in to comment.