Commit 7827fce0 authored by Keith Packard's avatar Keith Packard
Browse files

Allow input devices to be closed while the VT is switched away (needs

    per-driver support)
parent 3eaea660
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.h,v 1.27 2002/10/18 06:08:10 keithp Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/kdrive.h,v 1.28 2002/11/05 05:28:34 keithp Exp $ */
#include <stdio.h> #include <stdio.h>
#include "X.h" #include "X.h"
...@@ -615,6 +615,11 @@ KdAllocInputType (void); ...@@ -615,6 +615,11 @@ KdAllocInputType (void);
Bool Bool
KdRegisterFd (int type, int fd, void (*read) (int fd, void *closure), void *closure); KdRegisterFd (int type, int fd, void (*read) (int fd, void *closure), void *closure);
void
KdRegisterFdEnableDisable (int fd,
int (*enable) (int fd, void *closure),
void (*disable) (int fd, void *closure));
void void
KdUnregisterFds (int type, Bool do_close); KdUnregisterFds (int type, Bool do_close);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.28 2002/10/31 18:29:50 keithp Exp $ */ /* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.29 2002/11/05 05:28:34 keithp Exp $ */
#include "kdrive.h" #include "kdrive.h"
#include "inputstr.h" #include "inputstr.h"
...@@ -80,7 +80,7 @@ typedef struct _kdInputFd { ...@@ -80,7 +80,7 @@ typedef struct _kdInputFd {
int type; int type;
int fd; int fd;
void (*read) (int fd, void *closure); void (*read) (int fd, void *closure);
void (*enable) (int fd, void *closure); int (*enable) (int fd, void *closure);
void (*disable) (int fd, void *closure); void (*disable) (int fd, void *closure);
void *closure; void *closure;
} KdInputFd; } KdInputFd;
...@@ -215,7 +215,7 @@ KdRegisterFd (int type, int fd, void (*read) (int fd, void *closure), void *clos ...@@ -215,7 +215,7 @@ KdRegisterFd (int type, int fd, void (*read) (int fd, void *closure), void *clos
void void
KdRegisterFdEnableDisable (int fd, KdRegisterFdEnableDisable (int fd,
void (*enable) (int fd, void *closure), int (*enable) (int fd, void *closure),
void (*disable) (int fd, void *closure)) void (*disable) (int fd, void *closure))
{ {
int i; int i;
...@@ -274,9 +274,9 @@ KdEnableInput (void) ...@@ -274,9 +274,9 @@ KdEnableInput (void)
kdInputEnabled = TRUE; kdInputEnabled = TRUE;
for (i = 0; i < kdNumInputFds; i++) for (i = 0; i < kdNumInputFds; i++)
{ {
KdAddFd (kdInputFds[i].fd);
if (kdInputFds[i].enable) if (kdInputFds[i].enable)
(*kdInputFds[i].enable) (kdInputFds[i].fd, kdInputFds[i].closure); kdInputFds[i].fd = (*kdInputFds[i].enable) (kdInputFds[i].fd, kdInputFds[i].closure);
KdAddFd (kdInputFds[i].fd);
} }
/* reset screen saver */ /* reset screen saver */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment