diff options
Diffstat (limited to 'xorg-server/Xext/saver.c')
-rw-r--r-- | xorg-server/Xext/saver.c | 55 |
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; |