static int ProcXCalibrateSetRawMode (ClientPtr client) { REQUEST(xXCalibrateRawModeReq); xXCalibrateRawModeReply rep; REQUEST_SIZE_MATCH (xXCalibrateRawModeReq); memset (&rep, 0, sizeof (rep)); rep.type = X_Reply; rep.sequenceNumber = client->sequence; if (stuff->on) { if (xcalibrate_client == NULL) { /* Start calibrating. */ xcalibrate_client = client; tslib_raw_event_hook = xcalibrate_event_hook; tslib_raw_event_closure = client; rep.status = GrabSuccess; } else { rep.status = AlreadyGrabbed; } } else { if (xcalibrate_client == client) { /* Stop calibrating. */ xcalibrate_client = NULL; tslib_raw_event_hook = NULL; tslib_raw_event_closure = NULL; rep.status = GrabSuccess; /* Cycle input off and on to reload configuration. */ KdDisableInput (); KdEnableInput (); } else { rep.status = AlreadyGrabbed; } } if (client->swapped) { int n; swaps (&rep.sequenceNumber, n); swaps (&rep.status, n); } WriteToClient(client, sizeof (rep), (char *) &rep); return (client->noClientException); }
void KdSuspend(void) { KdCardInfo *card; KdScreenInfo *screen; if (kdEnabled) { for (card = kdCardInfo; card; card = card->next) { for (screen = card->screenList; screen; screen = screen->next) if (screen->mynum == card->selected && screen->pScreen) KdDisableScreen(screen->pScreen); if (card->driver && card->cfuncs->restore) (*card->cfuncs->restore) (card); } KdDisableInput(); KdDoSwitchCmd("suspend"); } }