LCL/gtk3: Fix tiny font sizes in some specific cases. Issue #40358, patch by Anton Kavalenka.

This commit is contained in:
wp_xyz 2023-07-18 23:58:36 +02:00
parent d3386f4a73
commit 051c6c7065

View File

@ -1985,6 +1985,8 @@ begin
end;
function TGtk3WidgetSet.GetDeviceCaps(DC: HDC; Index: Integer): Integer;
var
pscr: PGdkScreen;
begin
{$IFDEF GTK3DEBUGNOTIMPLEMENTED}
if (Index <> BITSPIXEL) and (Index <> LOGPIXELSX) and (Index <> LOGPIXELSY) then
@ -2028,14 +2030,11 @@ begin
end;
PLANES: Result := 1;
SIZEPALETTE: Result := gdk_window_get_visual(gdk_get_default_root_window)^.get_colormap_size;
LOGPIXELSX : { Logical pixels per inch in X }
begin
Result := LazUtilities.RoundToInt(gdk_screen_width / (gdk_screen_width_mm / 25.4));
end;
LOGPIXELSY : { Logical pixels per inch in Y }
LOGPIXELSX, LOGPIXELSY : { Logical pixels per inch in X and Y }
begin
Result := LazUtilities.RoundToInt(gdk_screen_height / (gdk_screen_height_mm / 25.4));
pscr := TGdkScreen.get_default;
Result := round(pscr^.get_resolution);
end;
end;