8

I have a laptop with an external monitor and switch between both screens using xrandr --auto and xrandr --off. Sometimes when I change the screen the font size in programs is suddenly weirdly big. This doesn't affect programs that were started before. I'm using Lubuntu 16.04.

I was able to reproduce the error using this chain of commands multiple times:

xrandr --output eDP1 --off && sleep 1 && xrandr --output eDP1 --auto

The external monitor has nothing to do with this, just disabling the laptop screen (eDP1) and enabling it again suffices to get these weird font size problems.

Edit: What really was changed by xrandr --off is the screen's DPI, see here:

$ xdpyinfo | grep dots
  resolution:    96x96 dots per inch                                                                                                                                              
$ xrandr --output eDP1 --off && sleep 1 && xrandr --output eDP1 --auto 
$ xdpyinfo | grep dots
  resolution:    204x205 dots per inch

Examples

For scale: The buttons are normal-sized. Normal VLC window in background, changed one in foreground.

vlc

GnuCash

What I tried so far

I tried to play around with Lubuntu's (untouched) font settings and can reset the fonts to normal (which should be 11) by choosing font size 6, but the fonts in already open applications (panel etc.) then change to what's really size 6. The only way to set things to normal is logging off and back in again or systemctl restart lightdm.service.

I discovered a possible workaround: At least until today the issue didn't return since I look out for having at least one monitor enabled at any time. So to change from monitor eDP1 to DP2 I do

xrandr --output DP2 --auto && xrandr --output eDP1 --off

This works for now, but of course doesn't solve the problem.

How can I reset the font size when this occurs?

Terminal command outputs

  • xrandr, external monitor (DP2) connected and enabled, laptop screen (eDP1) off
  • check ~/.xsession-errors file, it may have some hints on reasons. (This file contains stderr of all X applications). – George Shuklin Sep 8 '17 at 20:40
  • You are doing something strange. My .xsession-errors file is about 4k lines long and growing. – George Shuklin Sep 16 '17 at 20:26
  • @dessert, unfortunately, without any output from software it's really hard to guess. The issue is not within xradr, so one need to see all error messages in the session to guess a source of problems. Try to find any other user-related logging facility. May be journalctl --user? Or something is wrong with .xsession-error output. Try to touch and reboot. (end of guess list). – George Shuklin Sep 18 '17 at 13:30
2
+100

You can change the size of fonts for future windows opened by opening the terminal and using:

xrandr --dpi 96

For higher resolution (1920x1080) monitors try using:

xrandr --dpi 144

I use this on programs that do not implement HiDPI scaling themselves. Although it may not explain your problem it may solve it. Or it may not... YMMV.

  • Congratulations, this simple solution totally solved the issue! I reproduced the error, ran xrandr --dpi 96 and the font size was reset back to normal for new opened windows. – dessert Sep 24 '17 at 7:25
  • xdpyinfo | grep dots makes the DPI change issued by xrandr visible. – dessert Sep 24 '17 at 8:03
  • @dessert Yes I kind of knew about sdpyinfo | grep dots late last year but forgot how to find it to include in my answer. Thanks for both of your comments :) – WinEunuuchs2Unix Sep 24 '17 at 17:24

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.