diff options
author | Po Lu <luangruo@yahoo.com> | 2022-11-19 13:59:53 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-11-19 13:59:53 +0800 |
commit | b18d4dbe0d64bd1277731f9a7faedbb4dd3cd197 (patch) | |
tree | f611fd6ba7cf9a19f7b9ba317840d9b04daaea71 /src/xsettings.c | |
parent | 10701635cfefde5e416215d72f4dababe0ce8d7f (diff) | |
download | emacs-b18d4dbe0d64bd1277731f9a7faedbb4dd3cd197.tar.gz |
Fix automatic DPI adjustment and add workarounds for some systems
* lisp/faces.el (x-create-frame-with-faces): New field
`delayed-font'. Set the `font-parameter' property to `font' in
the given parameter list after face-set-after-frame-default is
called.
* src/fontset.c (Fset_fontset_font): Avoid changing
`font-parameter' with the call to Fmodify_frame_parameters.
* src/frame.c (gui_set_frame_parameters_1): New function.
Factor out gui_set_frame_parameters here, and add an argument
DEFAULT_PARAMETER. If the `font' parameter is set, and
`default_parameter' is not, then set the `font-parameter' frame
parameter to the `font' parameter as well, to keep track of
which user-specified `font' frame parameter set the default
face's font on the frame.
(gui_set_frame_parameters): Call gui_set_frame_parameters_1 with
new arg set to false.
(gui_set_font): Remove broken implementation of
`font-parameter'.
(gui_default_parameter): If the default value was used, then
call gui_set_frame_parameters_1 with the new argument set to
false. This is because no font was specified as a frame
parameter by the user, so Freconsider_frame_fonts is free to do
anything it wants.
(Freconsider_frame_fonts): If `font-parameter' is set, then use
it.
(syms_of_frame): New defsym Qfont_parameter.
* src/frame.h: Update prototypes.
* src/haikuterm.c (haiku_default_font_parameter):
* src/pgtkfns.c (pgtk_default_font_parameter):
* src/w32fns.c (w32_default_font_parameter): Stop setting
`font-parameter' here. This code resulted in decades of
automatic font rescaling not working correctly.
* src/xfaces.c (set_font_frame_param): Clear the
`font-parameter' frame parameter.
(Finternal_merge_in_global_face):
* src/xfns.c (x_default_font_parameter): Avoid changing
`font-parameter' in response to changes to face attributes.
* src/xsettings.c (apply_xft_settings): Add workaround for
Cairo. (bug#59371, bug#59347, bug#59283, bug#59271, bug#59285,
bug#59306.)
Diffstat (limited to 'src/xsettings.c')
-rw-r--r-- | src/xsettings.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xsettings.c b/src/xsettings.c index 1a9f1a8d5ae..f1ee84a1a02 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -886,6 +886,14 @@ apply_xft_settings (Display_Info *dpyinfo, } #endif +#ifdef USE_CAIRO + /* When Cairo is being used, set oldsettings.dpi to dpyinfo->resx. + This is a gross hack, but seeing as Cairo fails to report + anything reasonable, just use it to avoid config-changed events + being sent at startup. */ + oldsettings.dpi = dpyinfo->resx; +#endif + if ((settings->seen & SEEN_DPI) != 0 && settings->dpi > 0 /* The following conjunct avoids setting `changed' to true when |