1
0
OBS User unknown 2007-02-02 15:10:04 +00:00 committed by Git OBS Bridge
parent c3c2cd908b
commit 788c8a08d9
3 changed files with 64 additions and 51 deletions

View File

@ -31,65 +31,71 @@
DPMSSet(DPMSModeOn); DPMSSet(DPMSModeOn);
#endif #endif
if (XFD_ANYSET (&devicesReadable) || XFD_ANYSET (&clientsReadable)) 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.orig_1 2007-02-01 10:18:02.000000000 +0100
+++ hw/xfree86/common/xf86Events.c 2007-01-29 12:34:40.000000000 +0100 +++ hw/xfree86/common/xf86Events.c 2007-02-01 10:43:54.000000000 +0100
@@ -155,6 +155,10 @@ extern void (*xf86OSPMClose)(void); @@ -164,6 +164,7 @@ typedef struct x_IHRec {
InputHandlerProc ihproc;
pointer data;
Bool enabled;
+ Bool is_input;
struct x_IHRec * next;
} IHRec, *IHPtr;
static void xf86VTSwitch(void); @@ -1526,8 +1527,12 @@ xf86VTSwitch()
for (i = 0; i < xf86NumScreens; i++)
xf86Screens[i]->LeaveVT(i, 0);
+static fd_set *inputDevices = NULL; - for (ih = InputHandlers; ih; ih = ih->next)
+static void SetEnabledDevice(int fd); - xf86DisableInputHandler(ih);
+#define UnsetEnabledDevice(x) FD_CLR(x,inputDevices) + for (ih = InputHandlers; ih; ih = ih->next) {
+ + if (ih->is_input)
/* + xf86DisableInputHandler(ih);
* Allow arbitrary drivers or other XFree86 code to register with our main + else
* Wakeup handler. + xf86DisableGeneralHandler(ih);
@@ -1664,8 +1668,10 @@ xf86AddInputHandler(int fd, InputHandler + }
xf86AccessLeave(); /* We need this here, otherwise */
xf86AccessLeaveState(); /* console won't be restored */
@@ -1563,9 +1568,12 @@ xf86VTSwitch()
pInfo = pInfo->next;
}
#endif /* !__UNIXOS2__ */
- 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 {
@@ -1626,8 +1634,12 @@ xf86VTSwitch()
}
#endif /* !__UNIXOS2__ */
- 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);
}
@@ -1664,8 +1676,10 @@ xf86AddInputHandler(int fd, InputHandler
{ {
IHPtr ih = addInputHandler(fd, proc, data); IHPtr ih = addInputHandler(fd, proc, data);
- if (ih) - if (ih)
+ if (ih) { + if (ih) {
AddEnabledDevice(fd); AddEnabledDevice(fd);
+ SetEnabledDevice(fd); + ih->is_input = TRUE;
+ } + }
return ih; 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. */

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Feb 1 11:03:39 CET 2007 - sndirsch@suse.de
- improved bug-197858_dpms.diff to fix Xserver crash (Bug #197858)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jan 29 16:40:43 CET 2007 - sndirsch@suse.de Mon Jan 29 16:40:43 CET 2007 - sndirsch@suse.de

View File

@ -21,7 +21,7 @@ BuildRequires: libjpeg-devel
URL: http://xorg.freedesktop.org/ URL: http://xorg.freedesktop.org/
%define EXPERIMENTAL 0 %define EXPERIMENTAL 0
Version: 7.2 Version: 7.2
Release: 49 Release: 50
License: X11/MIT License: X11/MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/X11/Servers/XF86_4 Group: System/X11/Servers/XF86_4
@ -500,6 +500,8 @@ exit 0
%endif %endif
%changelog -n xorg-x11-server %changelog -n xorg-x11-server
* Thu Feb 01 2007 - sndirsch@suse.de
- improved bug-197858_dpms.diff to fix Xserver crash (Bug #197858)
* Mon Jan 29 2007 - sndirsch@suse.de * Mon Jan 29 2007 - sndirsch@suse.de
- bug-197858_dpms.diff: - bug-197858_dpms.diff:
* finally fixed "X server wakes up on any ACPI event" issue * finally fixed "X server wakes up on any ACPI event" issue