Linux – Screen corruption after hibernate — Is there another way to refresh the X11 display

desktopdesktop-environmenthibernatelinuxxorg

When I restore from hibernate the screen is often corrupted. I suspect the graphics memory is not being saved. Suspend-to-ram works fine otherwise.

It also looks like the font-cache is corrupted, as all letters are corrupted consistently. The effect seems to target a font at a specific size. E.g. if my terminal window is hit, changing the font and/or the font size will fix it, unless that font with that size is already damaged.

If the font is used elsewhere (other apps, window manager, etc.), then the problem is there as well. Sometimes the font used for the window titles is hit, then all window titles show the same letters corrupted.

Logging out and back in again fixes it, but I don't want to have to do that. I have been logging-out then hibernating, but this is more effort and eliminates most of the benefit of hibernate.

Is there another way to refresh the X11 display? The Ctrl+Alt+F1… does not fix it either. It switches terminal but does not redraw anything: It just shows the old corrupted screen.

I am using Debian 6.

In this occasion the window title is bad:
window title font deranged

Terminal content bad, but title is (still) okay:
text is distorted systematically, but only some fonts affected

Best Answer

I had a similar situation with my laptop. The screen would often remain black when it woke from suspend. My solution was to use xrandr to reset my displays. You need to find the xrandr command that sets up your layout and run that. For example, on my system, I had two screens and this set it up as I wanted it:

xrandr --output DP-3 --auto --output VGA-0 --auto --right-of DP-3 --primary

If you only have a single screen, you could try switching it off and on again:

xrandr --output VGA-1 --off; xrandr --output VGA-1 --auto;

You can see the names of your screens by running xrandr with no arguments. On the system I am using now (one VGA screen), I get:

$ xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
VGA-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0*+
   1680x1050      60.0  
   1280x1024      75.0     60.0  
   1152x864       75.0  
   1024x768       75.1     60.0  
   800x600        75.0     60.3  
   640x480        75.0     60.0  
   720x400        70.1  
DVI-I-1 disconnected (normal left inverted right x axis y axis)

Once you find the right command, assign it a shortcut so you can run it even when the screen is blank.

Related Question