xorg-x11-server/bug-197858_dpms.diff

105 lines
2.9 KiB
Diff

--- os/WaitFor.c.orig 2007-08-23 21:04:55.000000000 +0200
+++ os/WaitFor.c 2007-09-29 17:25:11.868664250 +0200
@@ -141,6 +141,7 @@ static OsTimerPtr timers = NULL;
* For more info on ClientsWithInput, see ReadRequestFromClient().
* pClientsReady is an array to store ready client->index values into.
*****************/
+volatile fd_set tmp_set;
int
WaitForSomething(int *pClientsReady)
@@ -295,10 +296,9 @@ WaitForSomething(int *pClientsReady)
if (expired)
return 0;
}
- }
+ }
else
- {
- fd_set tmp_set;
+ {
if (*checkForInput[0] == *checkForInput[1]) {
if (timers)
@@ -335,6 +335,12 @@ WaitForSomething(int *pClientsReady)
QueueWorkProc(EstablishNewConnections, NULL,
(pointer)&LastSelectMask);
+#ifdef DPMSExtension
+ XFD_ANDSET(&tmp_set, &devicesReadable, &EnabledDevices);
+ if (XFD_ANYSET (&tmp_set) && (DPMSPowerLevel != DPMSModeOn))
+ DPMSSet(serverClient, DPMSModeOn);
+#endif
+
if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable))
break;
#ifdef WIN32
--- hw/xfree86/common/xf86Events.c.orig 2007-09-05 23:59:13.000000000 +0200
+++ hw/xfree86/common/xf86Events.c 2007-09-29 17:29:22.620335250 +0200
@@ -143,6 +143,7 @@ typedef struct x_IHRec {
InputHandlerProc ihproc;
pointer data;
Bool enabled;
+ Bool is_input;
struct x_IHRec * next;
} IHRec, *IHPtr;
@@ -877,8 +878,12 @@ xf86VTSwitch()
for (i = 0; i < xf86NumScreens; i++)
xf86Screens[i]->LeaveVT(i, 0);
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86DisableInputHandler(ih);
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->is_input)
+ xf86DisableInputHandler(ih);
+ else
+ xf86DisableGeneralHandler(ih);
+ }
xf86AccessLeave(); /* We need this here, otherwise */
xf86AccessLeaveState(); /* console won't be restored */
@@ -916,9 +921,12 @@ xf86VTSwitch()
}
/* XXX HACK */
xf86ReleaseKeys(inputInfo.keyboard);
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86EnableInputHandler(ih);
-
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->is_input)
+ xf86EnableInputHandler(ih);
+ else
+ xf86EnableGeneralHandler(ih);
+ }
xf86UnblockSIGIO(prevSIGIO);
} else {
@@ -981,8 +989,12 @@ xf86VTSwitch()
/* XXX HACK */
xf86ReleaseKeys(inputInfo.keyboard);
- for (ih = InputHandlers; ih; ih = ih->next)
- xf86EnableInputHandler(ih);
+ for (ih = InputHandlers; ih; ih = ih->next) {
+ if (ih->is_input)
+ xf86EnableInputHandler(ih);
+ else
+ xf86EnableGeneralHandler(ih);
+ }
xf86UnblockSIGIO(prevSIGIO);
}
@@ -1019,8 +1031,10 @@ xf86AddInputHandler(int fd, InputHandler
{
IHPtr ih = addInputHandler(fd, proc, data);
- if (ih)
+ if (ih) {
AddEnabledDevice(fd);
+ ih->is_input = TRUE;
+ }
return ih;
}