milkypostman / powerline

emacs powerline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should handle DPI change

vincentbernat opened this issue · comments

When DPI changes, Emacs automatically updates the font on all affected frames. This is done through xsettings. However, the glyph computed by powerline are not updated. This can be fixed by invoking (pl/reset-cache).

I have tried to attach a hook to after-setting-font-hook, without any success.

Another possibility would be to put an advice around font-setting-change-default-font:

(defun vbe/after-font-setting-change-default-font (display-or-frame set-font)
    (pl/reset-cache))
(advice-add 'font-setting-change-default-font
            :after #'vbe/after-font-setting-change-default-font)

Works for me, but dunno if it's a good idea.