|
Lines 155-160
extern void (*xf86OSPMClose)(void);
Link Here
|
| 155 |
|
155 |
|
| 156 |
static void xf86VTSwitch(void); |
156 |
static void xf86VTSwitch(void); |
| 157 |
|
157 |
|
|
|
158 |
static fd_set *inputDevices = NULL; |
| 159 |
static void SetEnabledDevice(int fd); |
| 160 |
#define UnsetEnabledDevice(x) FD_CLR(x,inputDevices) |
| 161 |
|
| 158 |
/* |
162 |
/* |
| 159 |
* Allow arbitrary drivers or other XFree86 code to register with our main |
163 |
* Allow arbitrary drivers or other XFree86 code to register with our main |
| 160 |
* Wakeup handler. |
164 |
* Wakeup handler. |
|
Lines 1664-1671
xf86AddInputHandler(int fd, InputHandler
Link Here
|
| 1664 |
{ |
1668 |
{ |
| 1665 |
IHPtr ih = addInputHandler(fd, proc, data); |
1669 |
IHPtr ih = addInputHandler(fd, proc, data); |
| 1666 |
|
1670 |
|
| 1667 |
if (ih) |
1671 |
if (ih) { |
| 1668 |
AddEnabledDevice(fd); |
1672 |
AddEnabledDevice(fd); |
|
|
1673 |
SetEnabledDevice(fd); |
| 1674 |
} |
| 1669 |
return ih; |
1675 |
return ih; |
| 1670 |
} |
1676 |
} |
| 1671 |
|
1677 |
|
|
Lines 1708-1715
xf86RemoveInputHandler(pointer handler)
Link Here
|
| 1708 |
ih = handler; |
1714 |
ih = handler; |
| 1709 |
fd = ih->fd; |
1715 |
fd = ih->fd; |
| 1710 |
|
1716 |
|
| 1711 |
if (ih->fd >= 0) |
1717 |
if (ih->fd >= 0) { |
| 1712 |
RemoveEnabledDevice(ih->fd); |
1718 |
RemoveEnabledDevice(ih->fd); |
|
|
1719 |
UnsetEnabledDevice(ih->fd); |
| 1720 |
} |
| 1713 |
removeInputHandler(ih); |
1721 |
removeInputHandler(ih); |
| 1714 |
|
1722 |
|
| 1715 |
return fd; |
1723 |
return fd; |
|
Lines 1772-1778
xf86EnableInputHandler(pointer handler)
Link Here
|
| 1772 |
|
1780 |
|
| 1773 |
ih = handler; |
1781 |
ih = handler; |
| 1774 |
ih->enabled = TRUE; |
1782 |
ih->enabled = TRUE; |
| 1775 |
if (ih->fd >= 0) |
1783 |
if (ih->fd >= 0 && FD_ISSET(ih->fd, inputDevices)) |
| 1776 |
AddEnabledDevice(ih->fd); |
1784 |
AddEnabledDevice(ih->fd); |
| 1777 |
} |
1785 |
} |
| 1778 |
|
1786 |
|
|
Lines 1831-1836
xf86ReloadInputDevs(int sig)
Link Here
|
| 1831 |
return; |
1839 |
return; |
| 1832 |
} |
1840 |
} |
| 1833 |
|
1841 |
|
|
|
1842 |
static void SetEnabledDevice(int x) |
| 1843 |
{ |
| 1844 |
if (!inputDevices) { |
| 1845 |
inputDevices = xcalloc(sizeof (fd_set), 1); |
| 1846 |
FD_ZERO(inputDevices); |
| 1847 |
}; |
| 1848 |
FD_SET(x,inputDevices); |
| 1849 |
} |
| 1850 |
|
| 1834 |
#ifdef WSCONS_SUPPORT |
1851 |
#ifdef WSCONS_SUPPORT |
| 1835 |
|
1852 |
|
| 1836 |
/* XXX Currently XKB is mandatory. */ |
1853 |
/* XXX Currently XKB is mandatory. */ |