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

109 lines
3.0 KiB
Diff

Index: hw/xfree86/common/xf86Events.c
===================================================================
--- hw/xfree86/common/xf86Events.c.orig
+++ hw/xfree86/common/xf86Events.c
@@ -124,6 +124,7 @@ typedef struct x_IHRec {
InputHandlerProc ihproc;
pointer data;
Bool enabled;
+ Bool is_input;
struct x_IHRec * next;
} IHRec, *IHPtr;
@@ -513,8 +514,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 */
@@ -552,9 +557,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 {
@@ -617,8 +625,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);
}
@@ -655,8 +667,10 @@ xf86AddInputHandler(int fd, InputHandler
{
IHPtr ih = addInputHandler(fd, proc, data);
- if (ih)
+ if (ih) {
AddEnabledDevice(fd);
+ ih->is_input = TRUE;
+ }
return ih;
}
Index: os/WaitFor.c
===================================================================
--- os/WaitFor.c.orig
+++ os/WaitFor.c
@@ -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)
@@ -278,10 +279,9 @@ WaitForSomething(int *pClientsReady)
if (expired)
return 0;
}
- }
+ }
else
- {
- fd_set tmp_set;
+ {
if (*checkForInput[0] == *checkForInput[1]) {
if (timers)
@@ -316,6 +316,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;
/* check here for DDXes that queue events during Block/Wakeup */