1 |
On Thu, Mar 17, 2011 at 02:36:35PM +0100, YoYo Siska wrote |
2 |
|
3 |
> Might be that something happens to X's DPI settings during the |
4 |
> suspend/resume... |
5 |
> You can try to comaper the outputs of |
6 |
> xdpyinfo | egrep "dimensions|resolution" |
7 |
> and maybe |
8 |
> xrandr |
9 |
> befor and after the suspend. |
10 |
|
11 |
Thanks for the pointer. It turns out it's not related to hibernate, |
12 |
but rather to an interaction with xrandr resolution-switching. I've |
13 |
recently discovered a streaming website that shows old cartoons and |
14 |
other shows ( www.liketelevision.com ). I have a 24" LCD display |
15 |
(1920x1200) but the website displays less than 640x480. No problem, I |
16 |
said to myself. I cobbled together a few scripts. The first one for |
17 |
switching to 640x480 mode... (I call it "640x480") |
18 |
|
19 |
#!/bin/bash |
20 |
xrandr -s 640x480 |
21 |
xrandr --output HDMI1 --panning 1920x1200+0+0 |
22 |
|
23 |
...and a second one for 720x400... (I call it "720x400" |
24 |
|
25 |
#!/bin/bash |
26 |
xrandr -s 720x400 |
27 |
xrandr --output HDMI1 --panning 1920x1200+0+0 |
28 |
|
29 |
...and finally one to switch back to "normal" mode... (I call it "1920") |
30 |
|
31 |
#!/bin/bash |
32 |
xrandr -s 1920x1200 |
33 |
|
34 |
The problem started at about the same time I discovered |
35 |
www.liketelevision.com and began switching resolutions to watch it. |
36 |
Here's a test... |
37 |
|
38 |
#Get values before any switching |
39 |
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution" |
40 |
dimensions: 1920x1200 pixels (508x317 millimeters) |
41 |
resolution: 96x96 dots per inch |
42 |
|
43 |
#Switch to 640x480 |
44 |
waltdnes@i3 ~ $ 640x480 |
45 |
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution" |
46 |
dimensions: 1920x1200 pixels (1268x792 millimeters) |
47 |
resolution: 38x38 dots per inch |
48 |
|
49 |
#Switch to 720x400 |
50 |
waltdnes@i3 ~ $ 720x400 |
51 |
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution" |
52 |
dimensions: 1920x1200 pixels (3801x2376 millimeters) |
53 |
resolution: 13x13 dots per inch |
54 |
|
55 |
#Switch back to 1920x1200 |
56 |
waltdnes@i3 ~ $ 1920 |
57 |
waltdnes@i3 ~ $ xdpyinfo | egrep "dimensions|resolution" |
58 |
dimensions: 1920x1200 pixels (3801x2376 millimeters) |
59 |
resolution: 13x13 dots per inch |
60 |
|
61 |
Here's a gem from the xrandr man page. Note the part that I have |
62 |
emphasized... |
63 |
|
64 |
--fbmm widthxheight |
65 |
Sets the reported values for the physical size of the screen. |
66 |
***NORMALLY, XRANDR RESETS THE REPORTED PHYSICAL SIZE VALUES*** |
67 |
to keep the DPI constant. This overrides that computation. |
68 |
|
69 |
|
70 |
The solution to my problem is to include the 2 lines... |
71 |
|
72 |
xrandr -fbmm 508x317 |
73 |
xrandr --dpi 96 |
74 |
|
75 |
...at the end of all 3 scripts. This forces the screensize and DPI back |
76 |
to their original values, and X is happy, and fonts fit properly. You |
77 |
learn something new every so often. |
78 |
|
79 |
-- |
80 |
Walter Dnes <waltdnes@××××××××.org> |