Bugzilla – Attachment 115856 Details for
Bug 197858
X server wakes up on any ACPI event
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Fix
diff.DPMS (text/plain), 2.58 KB, created by
Egbert Eich
on 2007-01-29 11:46:59 UTC
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Egbert Eich
Created:
2007-01-29 11:46:59 UTC
Size:
2.58 KB
patch
obsolete
>--- os/WaitFor.c.orig 2007-01-26 15:53:27.000000000 +0100 >+++ os/WaitFor.c 2007-01-29 11:24:14.000000000 +0100 >@@ -144,6 +144,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) >@@ -298,10 +299,9 @@ WaitForSomething(int *pClientsReady) > if (expired) > return 0; > } >- } >+ } > else >- { >- fd_set tmp_set; >+ { > > if (*checkForInput[0] == *checkForInput[1]) { > if (timers) >@@ -338,7 +338,8 @@ WaitForSomething(int *pClientsReady) > QueueWorkProc(EstablishNewConnections, NULL, > (pointer)&LastSelectMask); > #ifdef DPMSExtension >- if (XFD_ANYSET (&devicesReadable) && (DPMSPowerLevel != DPMSModeOn)) >+ XFD_ANDSET(&tmp_set, &devicesReadable, &EnabledDevices); >+ if (XFD_ANYSET (&tmp_set) && (DPMSPowerLevel != DPMSModeOn)) > DPMSSet(DPMSModeOn); > #endif > if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable)) >--- hw/xfree86/common/xf86Events.c.orig 2006-11-13 19:59:23.000000000 +0100 >+++ hw/xfree86/common/xf86Events.c 2007-01-29 12:34:40.000000000 +0100 >@@ -155,6 +155,10 @@ extern void (*xf86OSPMClose)(void); > > static void xf86VTSwitch(void); > >+static fd_set *inputDevices = NULL; >+static void SetEnabledDevice(int fd); >+#define UnsetEnabledDevice(x) FD_CLR(x,inputDevices) >+ > /* > * Allow arbitrary drivers or other XFree86 code to register with our main > * Wakeup handler. >@@ -1664,8 +1668,10 @@ xf86AddInputHandler(int fd, InputHandler > { > IHPtr ih = addInputHandler(fd, proc, data); > >- if (ih) >+ if (ih) { > AddEnabledDevice(fd); >+ SetEnabledDevice(fd); >+ } > return ih; > } > >@@ -1708,8 +1714,10 @@ xf86RemoveInputHandler(pointer handler) > ih = handler; > fd = ih->fd; > >- if (ih->fd >= 0) >+ if (ih->fd >= 0) { > RemoveEnabledDevice(ih->fd); >+ UnsetEnabledDevice(ih->fd); >+ } > removeInputHandler(ih); > > return fd; >@@ -1772,7 +1780,7 @@ xf86EnableInputHandler(pointer handler) > > ih = handler; > ih->enabled = TRUE; >- if (ih->fd >= 0) >+ if (ih->fd >= 0 && FD_ISSET(ih->fd, inputDevices)) > AddEnabledDevice(ih->fd); > } > >@@ -1831,6 +1839,15 @@ xf86ReloadInputDevs(int sig) > return; > } > >+static void SetEnabledDevice(int x) >+{ >+ if (!inputDevices) { >+ inputDevices = xcalloc(sizeof (fd_set), 1); >+ FD_ZERO(inputDevices); >+ }; >+ FD_SET(x,inputDevices); >+} >+ > #ifdef WSCONS_SUPPORT > > /* XXX Currently XKB is mandatory. */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 197858
:
105953
|
106208
|
106217
|
115856
|
116761