I'm running emacs 26.1 on ubuntu 18.04 on a Dell laptop with a high-resolution display. It works very well in that configuration. It also works very well when the laptop is plugged into a lower-resolution monitor.

What doesn't work is that when you attach or unplug the monitor, emacs does not adjust to the change in resolution. So when emacs was started without the monitor attached, and then later the monitor gets attached, text is very large in its physical dimensions. Going the other way, unplugging the monitor yields unreadably tiny text.

Other applications (e.g. firefox and gnome-terminal) don't suffer from this issue, presumably because they react to some signal from X or gnome and adjust to the change in resolution.

Is there any workaround for this problem other than restarting emacs? If not, what work needs to be done to emacs to make this work better (bug references?)?

  • How do new frames behave? Have you tried creating them with C-x 5 2? – user12563 Oct 20 '18 at 13:33
  • @DoMiNeLa10 it doesn't reset the appearance of the frame to that of a newly-started emacs. It did change the font size, though. – Croad Langshan May 11 '19 at 15:57
  • You might want to take a look at the DPI value reported by Xorg. You should be able to get it by running xdpyinfo | grep dots, you might want to run it in another terminal once you plug in your monitor, though. – user12563 May 11 '19 at 16:01
  • You're suggesting a script that I could run (by hand) to set font size(s) based on dpi @DoMiNeLa10? That might be a reasonable workaround, but I wonder if that will have the same effect as restarting emacs, because I think currently, no emacs font size settings change, but the apparent font size does change on plugging/unplugging? – Croad Langshan May 12 '19 at 12:41
  • The point was to verify that the DPI changes as you plug in a secondary monitor. In general, X applications tend not to respond to these changes, and I wasn't suggesting any solution with this, just showing a way to find the possible cause of the problem. – user12563 May 12 '19 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.