On Thu, Mar 17, 2011 at 02:36:35PM +0100, YoYo Siska wrote
> Might be that something happens to X's DPI settings during the
> suspend/resume...
> You can try to comaper the outputs of
> xdpyinfo | egrep "dimensions|resolution"
> and maybe
> xrandr
> befor and after the suspend.
Thanks for the pointer. It turns out it's not related to hibernate,
but rather to an interaction with xrandr resolution-switching. I've
recently discovered a streaming website that shows old cartoons and
other shows ( www.liketelevision.com ). I have a 24" LCD display
(1920x1200) but the website displays less than 640x480. No problem, I
said to myself. I cobbled together a few scripts. The first one for
switching to 640x480 mode... (I call it "640x480")
#!/bin/bash
xrandr -s 640x480
xrandr --output HDMI1 --panning 1920x1200+0+0
...and a second one for 720x400... (I call it "720x400"
#!/bin/bash
xrandr -s 720x400
xrandr --output HDMI1 --panning 1920x1200+0+0
...and finally one to switch back to "normal" mode... (I call it "1920")
#!/bin/bash
xrandr -s 1920x1200
The problem started at about the same time I discovered
www.liketelevision.com and began switching resolutions to watch it.
Here's a test...
#Get values before any switching
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution"
dimensions: 1920x1200 pixels (508x317 millimeters)
resolution: 96x96 dots per inch
#Switch to 640x480
waltdnes@i3 ~ $ 640x480
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution"
dimensions: 1920x1200 pixels (1268x792 millimeters)
resolution: 38x38 dots per inch
#Switch to 720x400
waltdnes@i3 ~ $ 720x400
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution"
dimensions: 1920x1200 pixels (3801x2376 millimeters)
resolution: 13x13 dots per inch
#Switch back to 1920x1200
waltdnes@i3 ~ $ 1920
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution"
dimensions: 1920x1200 pixels (3801x2376 millimeters)
resolution: 13x13 dots per inch
Here's a gem from the xrandr man page. Note the part that I have
emphasized...
--fbmm widthxheight
Sets the reported values for the physical size of the screen.
***NORMALLY, XRANDR RESETS THE REPORTED PHYSICAL SIZE VALUES***
to keep the DPI constant. This overrides that computation.
The solution to my problem is to include the 2 lines...
xrandr -fbmm 508x317
xrandr --dpi 96
...at the end of all 3 scripts. This forces the screensize and DPI back
to their original values, and X is happy, and fonts fit properly. You
learn something new every so often.
--
Walter Dnes <[email protected]>