summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Höglund <fredrik@kde.org>2006-03-31 18:43:09 +0000
committerFredrik Höglund <fredrik@kde.org>2006-03-31 18:43:09 +0000
commita183fb1a70d48155b67d98fb4e4aaca825842f12 (patch)
tree2fd8613736b7a02068482ec3666bb369d416f970
parent8bc4acacd1079637be310b71fb5b74a5b0717cc2 (diff)
Update the package version number to 1.1. Require scrnsaverproto >= 1.1.libXScrnSaver-1_1_0XORG-7_1XORG-7_0_99_901
Update the manpage to document the new XScreenSaverSuspend function. Add the implementation of XScreenSaverSuspend.
-rw-r--r--ChangeLog13
-rw-r--r--configure.ac4
-rw-r--r--man/Makefile.am3
-rw-r--r--man/Xss.man44
-rw-r--r--src/XScrnSaver.c20
5 files changed, 77 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d7dda4..febeef8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-03-31 Fredrik Höglund <fredrik@kde.org>
+
+ * configure.ac:
+ Update the package version number to 1.1.
+ Require scrnsaverproto >= 1.1.
+
+ * man/Makefile.am:
+ * man/Xss.man:
+ Update the manpage to document the new XScreenSaverSuspend function.
+
+ * src/XScrnSaver.c (XScreenSaverSuspend):
+ Add the implementation of XScreenSaverSuspend.
+
2006-02-12 Alan Coopersmith <alan.coopersmith@sun.com>
* man/Makefile.am:
diff --git a/configure.ac b/configure.ac
index fed340c..cb14797 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure.
AC_PREREQ([2.57])
-AC_INIT(libXScrnSaver, 1.0.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXScrnSaver)
+AC_INIT(libXScrnSaver, 1.1.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXScrnSaver)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
@@ -34,7 +34,7 @@ AC_PROG_CC
AC_PROG_LIBTOOL
# Check for dependencies
-PKG_CHECK_MODULES(XSCRNSAVER, x11 xext xextproto scrnsaverproto)
+PKG_CHECK_MODULES(XSCRNSAVER, x11 xext xextproto [scrnsaverproto >= 1.1])
AC_SUBST(XSCRNSAVER_CFLAGS)
AC_SUBST(XSCRNSAVER_LIBS)
diff --git a/man/Makefile.am b/man/Makefile.am
index e7ea480..2448746 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -68,7 +68,8 @@ Xss_shadows = \
XScreenSaverUnsetAttributes \
XScreenSaverRegister \
XScreenSaverUnregister \
- XScreenSaverGetRegistered
+ XScreenSaverGetRegistered \
+ XScreenSaverSuspend
shadows.DONE:
-rm -f $(Xss_shadows:=.@LIB_MAN_SUFFIX@)
diff --git a/man/Xss.man b/man/Xss.man
index 95fcb63..0a46fad 100644
--- a/man/Xss.man
+++ b/man/Xss.man
@@ -1,6 +1,6 @@
.\"
.\" $XFree86: xc/lib/Xss/Xss.man,v 1.1 2003/10/26 19:00:24 herrb Exp $
-.\" $XdotOrg$
+.\" $XdotOrg: lib/XScrnSaver/man/Xss.man,v 1.2 2004/04/23 18:43:51 eich Exp $
.\"
.\" Copyright (C) 2003 The XFree86 Project, Inc. All Rights Reserved.
.\"
@@ -97,6 +97,8 @@ Status XScreenSaverUnregister(Display *\fIdpy\fP, int \fIscreen\fP\^);
.HP
Status XScreenSaverGetRegistered(Display *\fIdpy\fP, int \fIscreen\fP,
XID *\fIxid\fP, Atom *\fItype\fP\^);
+.HP
+void XScreenSaverSuspend(Display *\fIdpy\fP, Bool \fIsuspend\fP\^);
.PP
.SH DESCRIPTION
The X Window System provides support for changing the image on a
@@ -168,7 +170,7 @@ screen server in \fIsaver_info\fP and a non-zero value is
returned.
If the extension is not supported, \fIsaver_info\fP is not changed and 0
is returned.
-.br
+.PP
The \fIstate\fP field specifies whether or not the screen saver is currently
active and how the \fItil-or-since\fP value should be interpreted:
.TP 4
@@ -183,7 +185,7 @@ the number of milliseconds since the screen saver activated.
.TP 4
.I Disabled
The screen saver is currently disabled; \fItil-or-since\fP is zero.
-.br
+.PP
The \fIkind\fP field specifies the mechanism that either is currently being
used or would have been were the screen being saved:
.TP 4
@@ -304,6 +306,37 @@ the \fB_SCREEN_SAVER_ID\fP property on the
root window of the specified \fIscreen\fP.
It returns zero if an error is encountered or if the property does not
exist or is not of the correct format; otherwise it returns non-zero.
+.PP
+.B XScreenSaverSuspend
+temporarily suspends the screensaver and DPMS timer if \fIsuspend\fP
+is 'True', and restarts the timer if \fIsuspend\fP is 'False'.
+.br
+This function should be used by applications that don't want the
+screensaver or DPMS to become activated while they're for example in
+the process of playing a media sequence, or are otherwise continuously
+presenting visual information to the user while in a non-interactive
+state. This function is not intended to be called by an external
+screensaver application.
+.br
+If \fBXScreenSaverSuspend\fP is called multiple times with \fIsuspend\fP
+set to 'True', it must be called an equal number of times with
+\fIsuspend\fP set to 'False' in order for the screensaver timer to be
+restarted. This request has no affect if a client tries to resume the
+screensaver without first having suspended it.
+\fBXScreenSaverSuspend\fP can thus not be used by one client to resume
+the screensaver if it's been suspended by another client.
+.br
+If a client that has suspended the screensaver becomes disconnected from
+the X server, the screensaver timer will automatically be restarted, unless
+it's still suspended by another client. Suspending the screensaver timer
+doesn't prevent the screensaver from being forceably activated with the
+\fBForceScreenSaver\fP request, or a DPMS mode from being set with the
+\fBDPMSForceLevel\fP request.
+.br
+\fBXScreenSaverSuspend\fP also doesn't deactivate the screensaver or DPMS
+if either is active at the time the request to suspend them is received by
+the X server. But once they've been deactivated, they won't automatically
+be activated again, until the client has canceled the suspension.
.SH "ERRORS"
.B XScreenSaverSelectInput,
.B XScreenSaverQueryInfo,
@@ -317,6 +350,11 @@ If any undefined bits are set in \fIevent-mask\fP,
a BadValue error is generated by
.B XScreenSaverSelectInput .
.PP
+.SH AVAILABILITY
+\fBXScreenSaverSuspend\fP is available in version 1.1 and later versions
+of the X Screen Saver Extension. Version 1.1 was first released with
+X11R7.1.
+.PP
.SH "SEE ALSO"
X(__miscmansuffix__)
.SH AUTHORS
diff --git a/src/XScrnSaver.c b/src/XScrnSaver.c
index 3727ae4..d6ed0f4 100644
--- a/src/XScrnSaver.c
+++ b/src/XScrnSaver.c
@@ -439,4 +439,22 @@ Status XScreenSaverGetRegistered (dpy, screen, xid, type)
XFree ((char *) ulp);
}
return retval;
-}
+}
+
+void
+XScreenSaverSuspend (Display *dpy, Bool suspend)
+{
+ XExtDisplayInfo *info = find_display (dpy);
+ xScreenSaverSuspendReq *req;
+
+ ScreenSaverSimpleCheckExtension (dpy, info);
+
+ LockDisplay (dpy);
+ GetReq (ScreenSaverSuspend, req);
+ req->reqType = info->codes->major_opcode;
+ req->saverReqType = X_ScreenSaverSuspend;
+ req->suspend = suspend;
+ UnlockDisplay (dpy);
+ SyncHandle ();
+}
+