2016-12-20 18:07:36 +01:00
|
|
|
Work around openSUSE bug #1016172
|
|
|
|
|
2023-08-02 09:57:39 +02:00
|
|
|
---
|
|
|
|
lisp/dynamic-setting.el | 12 ++++++++----
|
2016-12-21 15:38:25 +01:00
|
|
|
src/xsettings.c | 7 ++++++-
|
2023-08-02 09:57:39 +02:00
|
|
|
2 files changed, 14 insertions(+), 5 deletions(-)
|
2016-12-20 18:07:36 +01:00
|
|
|
|
|
|
|
--- lisp/dynamic-setting.el
|
2024-04-11 08:14:43 +02:00
|
|
|
+++ lisp/dynamic-setting.el 2024-04-11 06:03:25.603986456 +0000
|
2016-12-20 18:07:36 +01:00
|
|
|
@@ -33,6 +33,7 @@
|
|
|
|
;;; Customizable variables
|
|
|
|
|
|
|
|
(declare-function font-get-system-font "xsettings.c" ())
|
|
|
|
+(declare-function font-face-attributes "font.c" (font &optional frame))
|
|
|
|
|
|
|
|
(defvar font-use-system-font)
|
|
|
|
|
2023-08-02 09:57:39 +02:00
|
|
|
@@ -42,15 +43,18 @@ If DISPLAY-OR-FRAME is a frame, the disp
|
2016-12-20 18:07:36 +01:00
|
|
|
|
2020-08-13 12:38:32 +02:00
|
|
|
If SET-FONT is non-nil, change the font for frames. Otherwise re-apply
|
|
|
|
the current form for the frame (i.e. hinting or somesuch changed)."
|
2016-12-20 18:07:36 +01:00
|
|
|
- (let ((new-font (and (fboundp 'font-get-system-font)
|
2023-08-02 09:57:39 +02:00
|
|
|
+ (let ((system-font (and (fboundp 'font-get-system-font)
|
|
|
|
(font-get-system-font)))
|
2016-12-20 18:07:36 +01:00
|
|
|
- (frame-list (frames-on-display-list display-or-frame)))
|
|
|
|
- (when (and new-font (display-graphic-p display-or-frame))
|
2023-08-02 09:57:39 +02:00
|
|
|
+ (frame-list (frames-on-display-list display-or-frame))
|
2016-12-20 18:07:36 +01:00
|
|
|
+ (user-font (face-attribute 'default :font)))
|
|
|
|
+ (when (and system-font (display-graphic-p display-or-frame))
|
|
|
|
(clear-font-cache)
|
|
|
|
(if set-font
|
|
|
|
;; Set the font on all current and future frames, as though
|
|
|
|
;; the `default' face had been "set for this session":
|
|
|
|
- (set-frame-font new-font nil frame-list)
|
|
|
|
+ (if (not user-font)
|
2023-08-02 09:57:39 +02:00
|
|
|
+ (set-frame-font system-font nil frame-list)
|
2016-12-20 18:07:36 +01:00
|
|
|
+ (set-frame-font user-font nil frame-list))
|
2023-08-02 09:57:39 +02:00
|
|
|
;; Just reconsider the existing fonts on all frames on each
|
|
|
|
;; display, by clearing the font and face caches. This will
|
|
|
|
;; cause all fonts to be recreated.
|
2016-12-21 15:38:25 +01:00
|
|
|
--- src/xsettings.c
|
2024-04-11 08:14:43 +02:00
|
|
|
+++ src/xsettings.c 2024-04-11 06:04:36.790667318 +0000
|
|
|
|
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http
|
|
|
|
|
|
|
|
#include <float.h>
|
|
|
|
#include <limits.h>
|
2016-12-21 15:38:25 +01:00
|
|
|
+#include <math.h>
|
2024-04-11 08:14:43 +02:00
|
|
|
#include <fcntl.h>
|
2023-08-02 09:57:39 +02:00
|
|
|
|
2024-04-11 08:14:43 +02:00
|
|
|
#include <byteswap.h>
|
2023-08-02 09:57:39 +02:00
|
|
|
@@ -839,7 +840,11 @@ apply_xft_settings (Display_Info *dpyinf
|
2016-12-21 15:38:25 +01:00
|
|
|
#endif
|
|
|
|
FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &oldsettings.lcdfilter);
|
|
|
|
FcPatternGetInteger (pat, FC_RGBA, 0, &oldsettings.rgba);
|
|
|
|
- FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi);
|
|
|
|
+
|
|
|
|
+ if (FcPatternGetDouble (pat, FC_DPI, 0, &oldsettings.dpi) == FcResultMatch)
|
|
|
|
+ {
|
|
|
|
+ oldsettings.dpi = round(oldsettings.dpi);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if ((settings->seen & SEEN_AA) != 0 && oldsettings.aa != settings->aa)
|
|
|
|
{
|