Video refresh after sleep/wakeup

I have Fvwm on three systems under RH9 - on only one, a Dell Dimension450, the screen is trashed (lots of horiz white lines, snow, etc.) after a wakeup from sleep. Does not happen under RH9’s Gnome window/display manager. How can I force a video restore or refresh or something to get a clean screen back?

I have some close problem with a Dell latitude X300, but when I switch to console (ctrl-alt-F1) and back to X11, the display is restored. If this works, you can automate this by adding chvt 1 && chvt 7 is the script that suspend your computer.

I have refresh-problems using the windowmanager oroborus with xcompmgr (shadows), when I maximize or restore windows.

There are 2 solutions, that might help you:

  1. Via a script, open a window maximized and close it

  2. use this C-program:

#include <X11/Xlib.h>
#include <unistd.h>


void setUpTheWindow(void);	


Window win4;
Display *disp;
XSetWindowAttributes attr;

int screenWidth=0;
int screenHeight=0;

int winsize=4;

int main(int argc, char **argv)
{

   disp=XOpenDisplay(NULL);

	int screen=DefaultScreen(disp);
	screenWidth=XDisplayWidth(disp,screen);
	screenHeight=XDisplayHeight(disp,screen);


//screenWidth=1024;

        attr.override_redirect=True;

        win4=XCreateWindow(disp,DefaultRootWindow(disp),0,0,screenWidth,winsize,0,CopyFromParent,InputOutput,CopyFromParent,CWBackingStore|CWOverrideRedirect|CWEventMask|CWBorderPixel|CWSaveUnder|CWColormap|CWBackPixel,&attr);


	XSync(disp,False);
        XSetWindowBackground(disp, win4, WhitePixel(disp, DefaultScreen(disp)));

         int y=0;
         int step=40;

 while (y<=screenHeight+step) {

  
     XMoveWindow(disp,win4,0,y);
     XMapRaised(disp, win4);

     usleep(2);
     y+=step;
 
     //printf("y: %d\n", y);
 }

XSync(disp,False);

}

Save it as flush.c
compile it:
cc flush.c -oflush -I/usr/X11R6/include -L/usr/X11R6/lib -lX11

Now you can run ./flush

It creates a very small borderless Window, that is moved over the screen, what will redraw the screen.

You might have to change the values for winsize, step and usleep on your system.

Mark

Thanks, but all that does is refresh the Fvwm windows in all open apps – the root window is still trashed. I have to do an “xsetbg …” to restore the background (using a solid color or picture, same problem). Using the Fvwm menu item “refresh” has the same result – only the application windows are refreshed. Restarting Fvwm does not restore the root window image either: I have to execute the “xsetbg …” command from a shell.

I do not know whether the BIOS or some RH9 function is doing the sleep, although I have gone into the BIOS settings and turned off all available functions involving power management.

Doing “apm -i” or “apm --ignore” gives a “usage: apm [-vmMsSin] [–verbose] …” response, as if the apm command can not understand what to do.

Have a look at using ‘xrefresh’, or at least issuing ‘Refresh’ from FvwmConsole.

– Thomas Adam

“xrefresh” just cleans up the windows, as does the “Refresh” in the Fvwm menu. The root window picture is still trashed. Seems the only thing that cleans up the root window is to reset the image using “xsetbg”.

What I need, I think, is a way to find out what is trashing the video memory alocated for these graphics during “sleep”.

Ah, so it’s like that? Hmm. Pass. I couldn’t say what caused that. Depending on what card you have, there might be able to supply an option in your Xorg/XF86Config-4 file.

Have you checked your X11 logs?

– Thomas Adam

is there a way to stop refresh for a while? for example 5 seconds… xrefresh is not what i need
thanks

Essentially, no.

– Thomas Adam

good