From 32ce5c83a504d2cafd2b19ed628b40032ef347b3 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 5 Aug 2009 09:39:47 +1000 Subject: [PATCH] xnest: use AllocDevicePair for Xnest device initalization All Xnest needs is a single pointer+keyboard pair. AllocDevicePair sets them up nicely with the name assigned etc. Signed-off-by: Peter Hutterer --- hw/xnest/Init.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index 49a52d776..0765f73d0 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -89,14 +89,19 @@ InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) void InitInput(int argc, char *argv[]) { - xnestPointerDevice = AddInputDevice(serverClient, xnestPointerProc, TRUE); - xnestKeyboardDevice = AddInputDevice(serverClient, xnestKeyboardProc, TRUE); + int rc; + rc = AllocDevicePair(serverClient, "Xnest", + &xnestPointerDevice, + &xnestKeyboardDevice, + xnestPointerProc, + xnestKeyboardProc, + FALSE); + + if (rc != Success) + FatalError("Failed to init Xnest default devices.\n"); GetEventList(&xnestEvents); - RegisterPointerDevice(xnestPointerDevice); - RegisterKeyboardDevice(xnestKeyboardDevice); - mieqInit(); AddEnabledDevice(XConnectionNumber(xnestDisplay));