Bugzilla – Attachment 106208 Details for
Bug 197858
X server wakes up on any ACPI event
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
Patch to destinguish between general and input devices
diff.acpi (text/plain), 4.58 KB, created by
Egbert Eich
on 2006-11-20 11:01:45 UTC
(
hide
)
Description:
Patch to destinguish between general and input devices
Filename:
MIME Type:
Creator:
Egbert Eich
Created:
2006-11-20 11:01:45 UTC
Size:
4.58 KB
patch
obsolete
>diff -urp xorg-server-1.1.99.901/hw/xfree86/common/xf86Events.c ../xorg-server-1.1.99.901/hw/xfree86/common/xf86Events.c >--- xorg-server-1.1.99.901/hw/xfree86/common/xf86Events.c 2006-10-12 00:42:19.000000000 +0200 >+++ ../xorg-server-1.1.99.901/hw/xfree86/common/xf86Events.c 2006-11-20 11:44:16.000000000 +0100 >@@ -1636,8 +1636,9 @@ xf86VTSwitch() > > /* Input handler registration */ > >-_X_EXPORT pointer >-xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data) >+ >+static pointer >+addInputHandler(int fd, InputHandlerProc proc, pointer data) > { > IHPtr ih; > >@@ -1656,25 +1657,33 @@ xf86AddInputHandler(int fd, InputHandler > ih->next = InputHandlers; > InputHandlers = ih; > >- AddEnabledDevice(fd); >+ return ih; >+} > >+_X_EXPORT pointer >+xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data) >+{ >+ IHPtr ih = addInputHandler(fd, proc, data); >+ >+ if (ih) >+ AddEnabledDevice(fd); > return ih; > } > >-_X_EXPORT int >-xf86RemoveInputHandler(pointer handler) >+_X_EXPORT pointer >+xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) > { >- IHPtr ih, p; >- int fd; >- >- if (!handler) >- return -1; >+ IHPtr ih = addInputHandler(fd, proc, data); > >- ih = handler; >- fd = ih->fd; >- >- if (ih->fd >= 0) >- RemoveEnabledDevice(ih->fd); >+ if (ih) >+ AddGeneralSocket(fd); >+ return ih; >+} >+ >+static void >+removeInputHandler(IHPtr ih) >+{ >+ IHPtr p; > > if (ih == InputHandlers) > InputHandlers = ih->next; >@@ -1686,9 +1695,47 @@ xf86RemoveInputHandler(pointer handler) > p->next = ih->next; > } > xfree(ih); >+} >+ >+_X_EXPORT int >+xf86RemoveInputHandler(pointer handler) >+{ >+ IHPtr ih; >+ int fd; >+ >+ if (!handler) >+ return -1; >+ >+ ih = handler; >+ fd = ih->fd; >+ >+ if (ih->fd >= 0) >+ RemoveEnabledDevice(ih->fd); >+ removeInputHandler(ih); >+ >+ return fd; >+} >+ >+_X_EXPORT int >+xf86RemoveGeneralHandler(pointer handler) >+{ >+ IHPtr ih; >+ int fd; >+ >+ if (!handler) >+ return -1; >+ >+ ih = handler; >+ fd = ih->fd; >+ >+ if (ih->fd >= 0) >+ RemoveGeneralSocket(ih->fd); >+ removeInputHandler(ih); >+ > return fd; > } > >+ > _X_EXPORT void > xf86DisableInputHandler(pointer handler) > { >diff -urp xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_acpi.c ../xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_acpi.c >--- xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_acpi.c 2006-10-12 00:42:19.000000000 +0200 >+++ ../xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_acpi.c 2006-11-20 11:50:04.000000000 +0100 >@@ -163,7 +163,7 @@ lnxACPIOpen(void) > > xf86PMGetEventFromOs = lnxACPIGetEventFromOs; > xf86PMConfirmEventToOs = lnxACPIConfirmEventToOs; >- ACPIihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL); >+ ACPIihPtr = xf86AddGeneralHandler(fd,xf86HandlePMEvents,NULL); > xf86MsgVerb(X_INFO,3,"Open ACPI successful (%s)\n", ACPI_SOCKET); > > return lnxCloseACPI; >diff -urp xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_apm.c ../xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_apm.c >--- xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_apm.c 2006-10-12 00:42:19.000000000 +0200 >+++ ../xorg-server-1.1.99.901/hw/xfree86/os-support/linux/lnx_apm.c 2006-11-20 11:50:46.000000000 +0100 >@@ -180,7 +180,7 @@ lnxAPMOpen(void) > close(pfd); > xf86PMGetEventFromOs = lnxPMGetEventFromOs; > xf86PMConfirmEventToOs = lnxPMConfirmEventToOs; >- APMihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL); >+ APMihPtr = xf86AddGeneralHandler(fd,xf86HandlePMEvents,NULL); > xf86MsgVerb(X_INFO,3,"Open APM successful\n"); > return lnxCloseAPM; > } >diff -urp xorg-server-1.1.99.901/os/connection.c ../xorg-server-1.1.99.901/os/connection.c >--- xorg-server-1.1.99.901/os/connection.c 2006-10-12 00:42:19.000000000 +0200 >+++ ../xorg-server-1.1.99.901/os/connection.c 2006-11-20 11:48:24.000000000 +0100 >@@ -1014,23 +1014,35 @@ CloseDownConnection(ClientPtr client) > } > > _X_EXPORT void >-AddEnabledDevice(int fd) >+AddGeneralSocket(int fd) > { >- FD_SET(fd, &EnabledDevices); > FD_SET(fd, &AllSockets); > if (GrabInProgress) > FD_SET(fd, &SavedAllSockets); > } > > _X_EXPORT void >-RemoveEnabledDevice(int fd) >+AddEnabledDevice(int fd) >+{ >+ FD_SET(fd, &EnabledDevices); >+ AddGeneralSocket(fd); >+} >+ >+_X_EXPORT void >+RemoveGeneralSocket(int fd) > { >- FD_CLR(fd, &EnabledDevices); > FD_CLR(fd, &AllSockets); > if (GrabInProgress) > FD_CLR(fd, &SavedAllSockets); > } > >+_X_EXPORT void >+RemoveEnabledDevice(int fd) >+{ >+ FD_CLR(fd, &EnabledDevices); >+ RemoveGeneralSocket(fd); >+} >+ > /***************** > * OnlyListenToOneClient: > * Only accept requests from one client. Continue to handle new >
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