diff options
Diffstat (limited to 'xorg-server/Xext/saver.c')
-rw-r--r-- | xorg-server/Xext/saver.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c index 6c8fc6e0b..b0314faad 100644 --- a/xorg-server/Xext/saver.c +++ b/xorg-server/Xext/saver.c @@ -64,7 +64,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; @@ -412,7 +412,6 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced) ScreenSaverScreenPrivatePtr pPriv; ScreenSaverEventPtr pEv; unsigned long mask; - xScreenSaverNotifyEvent ev; int kind; UpdateCurrentTimeIf(); @@ -430,16 +429,17 @@ 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; + 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); + } } } @@ -652,7 +652,7 @@ ProcScreenSaverQueryVersion(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep); return Success; } @@ -683,10 +683,12 @@ ProcScreenSaverQueryInfo(ClientPtr client) UpdateCurrentTime(); lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds; + rep.type = X_Reply; - rep.length = 0; rep.sequenceNumber = client->sequence; + rep.length = 0; rep.window = pSaver->wid; + if (screenIsSaved != SCREEN_SAVER_OFF) { rep.state = ScreenSaverOn; if (ScreenSaverTime) @@ -723,7 +725,7 @@ ProcScreenSaverQueryInfo(ClientPtr client) swapl(&rep.idle); swapl(&rep.eventMask); } - WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep); return Success; } @@ -1390,7 +1392,7 @@ SProcScreenSaverDispatch(ClientPtr client) } void -ScreenSaverExtensionInit(INITARGS) +ScreenSaverExtensionInit(void) { ExtensionEntry *extEntry; int i; |