LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2003, 10:53 AM   #1
sparani
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
Angry About XForceScreenSaver


Hi, I have written a program to reset/set
the screen saver value in Desktop. The XForceScreenSaver()
is used for activate the ScreenSaver values. But it is
not reseting the value as expected. I have tried that
with the two modes and didn't get the expected output.
Her is the program, could you please let me know
why it is not reseting the values of screen saver.

Anyhelp on this is appriciated.

Regards,
Bala S

-----------------------------------------------------------------
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include <Xm/PushB.h>

XtAppContext appcon;
Widget shell1;
Display *display1;

void fnButton1(Widget w, XtPointer ca, XtPointer cl)
{
int i;

for(i = 0; i < 100; i++)
{
sleep(60);
XForceScreenSaver(display1, ScreenSaverActive);
}
}

int
main(int argc, char *argv[])
{
Arg args[2];
Cardinal num_args;
Widget button1;

XtToolkitInitialize();

num_args = 0;
XtSetArg(args[num_args], XtNwidth, 100); ++num_args;
XtSetArg(args[num_args], XtNheight, 100); ++num_args;

appcon = XtCreateApplicationContext();
display1 = XtOpenDisplay(appcon, "machinename:0.0", "test1", "Test", NULL, 0, &argc, argv);
shell1 = XtAppCreateShell("test1", "Test", applicationShellWidgetClass,
display1, args, num_args);
button1 = XmCreatePushButton(shell1, "Push", args, 0);
XtManageChild(button1);

XtAddCallback(button1, XmNactivateCallback, fnButton1, NULL);

XtRealizeWidget(shell1);

XtAppMainLoop(appcon);

return (0);
}
 
Old 10-17-2003, 01:55 AM   #2
rakriege
Member
 
Registered: Oct 2003
Location: San Deigo, CA
Distribution: FC3, Win2k Server, XP Pro & 2003 Server
Posts: 198

Rep: Reputation: 30
have you set the value in your env


did you export it


did you do it as root
 
Old 10-17-2003, 02:06 AM   #3
sparani
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Original Poster
Rep: Reputation: 0
You mean the display name? Offcourse I set the value
before running the program.
 
Old 10-17-2003, 02:08 AM   #4
sparani
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Original Poster
Rep: Reputation: 0
Is the value is set are reset only through root?
I belevie non-root user can also set/reset the values?
 
Old 10-17-2003, 02:11 AM   #5
rakriege
Member
 
Registered: Oct 2003
Location: San Deigo, CA
Distribution: FC3, Win2k Server, XP Pro & 2003 Server
Posts: 198

Rep: Reputation: 30
only for the current operating shell i beleive...neds export as root
 
Old 10-17-2003, 02:15 AM   #6
sparani
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Original Poster
Rep: Reputation: 0
You mean this can be checked through root and need to export
the DISPLAY? can you make this more clear to me?
 
Old 11-13-2003, 07:28 PM   #7
pralay
LQ Newbie
 
Registered: Nov 2003
Location: california
Posts: 1

Rep: Reputation: 0
Use XFlush()

Call XFlush() after calling XForceScreenSaver().
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 08:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration