aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext/saver.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-10 14:56:29 +0200
committermarha <marha@users.sourceforge.net>2012-07-10 14:56:29 +0200
commitd137057fd13e83ec15ab416c7fe774741da06047 (patch)
treef4b38caa4f3ecb983f00e84f4f4d8d66699ecbc5 /xorg-server/Xext/saver.c
parentc29d91cfd8df084f16d0d2dfa82c3a86f7719a73 (diff)
downloadvcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.tar.gz
vcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.tar.bz2
vcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.zip
fontconfig mesa xserver git update 10 Jul 2012
Diffstat (limited to 'xorg-server/Xext/saver.c')
-rw-r--r--xorg-server/Xext/saver.c55
1 files changed, 30 insertions, 25 deletions
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c
index 61fc044d7..ac4a633e7 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -58,7 +58,7 @@ in this Software without prior written authorization from the X Consortium.
#include <stdio.h>
-#include "modinit.h"
+#include "extinit.h"
static int ScreenSaverEventBase = 0;
@@ -406,7 +406,6 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
ScreenSaverScreenPrivatePtr pPriv;
ScreenSaverEventPtr pEv;
unsigned long mask;
- xScreenSaverNotifyEvent ev;
int kind;
UpdateCurrentTimeIf();
@@ -424,16 +423,18 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
else
kind = ScreenSaverInternal;
for (pEv = pPriv->events; pEv; pEv = pEv->next) {
- if (!(pEv->mask & mask))
- continue;
- ev.type = ScreenSaverNotify + ScreenSaverEventBase;
- ev.state = state;
- ev.timestamp = currentTime.milliseconds;
- ev.root = pScreen->root->drawable.id;
- ev.window = pScreen->screensaver.wid;
- ev.kind = kind;
- ev.forced = forced;
- WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
+ if (pEv->mask & mask) {
+ xScreenSaverNotifyEvent ev = {
+ .type = ScreenSaverNotify + ScreenSaverEventBase,
+ .state = state,
+ .timestamp = currentTime.milliseconds,
+ .root = pScreen->root->drawable.id,
+ .window = pScreen->screensaver.wid,
+ .kind = kind,
+ .forced = forced
+ };
+ WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
+ }
}
}
@@ -634,19 +635,21 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
static int
ProcScreenSaverQueryVersion(ClientPtr client)
{
- xScreenSaverQueryVersionReply rep;
+ xScreenSaverQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = SERVER_SAVER_MAJOR_VERSION,
+ .minorVersion = SERVER_SAVER_MINOR_VERSION
+ };
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
- rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
- WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep);
return Success;
}
@@ -677,10 +680,12 @@ ProcScreenSaverQueryInfo(ClientPtr client)
UpdateCurrentTime();
lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds;
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.window = pSaver->wid;
+ rep = (xScreenSaverQueryInfoReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .window = pSaver->wid
+ };
if (screenIsSaved != SCREEN_SAVER_OFF) {
rep.state = ScreenSaverOn;
if (ScreenSaverTime)
@@ -717,7 +722,7 @@ ProcScreenSaverQueryInfo(ClientPtr client)
swapl(&rep.idle);
swapl(&rep.eventMask);
}
- WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), (char *) &rep);
+ WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep);
return Success;
}
@@ -1384,7 +1389,7 @@ SProcScreenSaverDispatch(ClientPtr client)
}
void
-ScreenSaverExtensionInit(INITARGS)
+ScreenSaverExtensionInit(void)
{
ExtensionEntry *extEntry;
int i;