| Add the following statement before XResetScreenSaver. I had the same
problem and this works for my program.
XSetScreenSaver (disp, DisableScreenSaver, 600, PreferBlanking,
AllowExposures);
Wayne
|
|
Thank's for the quick reply, I haven't been able to get it to work
(yet). But it looks like the XResetScreenSaver cannot reset the screen
server unless there is a prior routine that either Sets, Activates or
Forces the screen saver. Surely XResetScreenSaver should unblank the
screen by itself... ?
Can anyone on the DECW development side clarify ?
Thank's
Rob
|
|
/* Save current settings */
XGetScreenSaver (dpy, &timeout, &interval, &blanking, &exposures);
/* Disable saver (keep screen from blanking) */
XSetScreenSaver (dpy, 0, interval, blanking, exposures);
XResetScreenSaver (dpy);
/* Enable saver (allow screen to blank after timeout) */
XSetScreenSaver (dpy, timeout, interval, blanking, exposures);
|
| Hi,
Thank's for the reply, below is a copy of the routine I am using, it
will not do a thing with the screen (ie: wont redisplay a screen that
has blanked off) unless there is an call to XActivateScreenSaver
preceding the reset call, I have only observed this using VMS DECW, on
Ultrix (local) it works fine without the need for an
XActivateScreenSaver (ie: roughly .2).
I have tried it using local and remote (DECNET) transport and it
appears that the XActivate... is needed, unfortunately if you run the
routine with the screen being displayed it will blank out, but if blank
it will be displayed (as desired). Can anyone spot what I am doing
wrong... is this a manifestation of a problem with the VMS DECW ?
Many Thank's for any replies
Rob
This will display the screen if blanked... and will blank it if it is
displayed.
Have run on the workstation in a command routine
$ wait some_time_so_screen_can_blank
$ run reset_screen_program
$ exit
Have also run remotely:
$ set display/create/node=node_name
$ run reset_screen_program
#include "Xlib.h"
#include "Xatom.h"
#include "Keysym.h"
#include <stdio.h>
int main(){
char *display1;
Display *disp;
Window window1;
int timeout_ret, interval_ret, blanking_ret, exposures_ret;
char c;
disp = XOpenDisplay(0);
XGetScreenSaver(disp, &timeout_ret, &interval_ret, &blanking_ret,
&exposures_ret);
printf("Timeout %d ; Interval %d ; Blanking %d ; Exposure %d ",
timeout_ret, interval_ret, blanking_ret,
exposures_ret);
XSetScreenSaver (disp,0, interval_ret, blanking_ret, exposures_ret);
XActivateScreenSaver(disp); /* Need this for it to work... but why ? */
XResetScreenSaver(disp);
XSetScreenSaver (disp, timeout_ret, interval_ret, blanking_ret,
exposures_ret);
XFlush(disp);
exit(1);
}
|