From 7790dc86384cc451ac44663737fde84dd81ad4e1 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sun, 25 Mar 2012 22:30:55 -0700 Subject: [PATCH] XQuartz: Use AllocDevicePair to allocate our keyboard and mouse at the same time Also correct isMaster to FALSE while we're here. Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer --- hw/xquartz/darwin.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index d826ebf21..5fbfa4d27 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -512,11 +512,13 @@ InitInput(int argc, char **argv) .rules = "base", .model = "empty", .layout = "empty", .variant = NULL, .options = NULL }; + /* We need to really have rules... or something... */ XkbSetRulesDflts(&rmlvo); - darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE); - darwinKeyboard->name = strdup("keyboard"); + assert(Success == AllocDevicePair(serverClient, "xquartz virtual", + &darwinPointer, &darwinKeyboard, + DarwinMouseProc, DarwinKeybdProc, FALSE)); /* here's the snippet from the current gdk sources: if (!strcmp (tmp_name, "pointer")) @@ -532,16 +534,16 @@ InitInput(int argc, char **argv) gdkdev->info.source = GDK_SOURCE_PEN; */ - darwinPointer = AddInputDevice(serverClient, DarwinMouseProc, TRUE); - darwinPointer->name = strdup("pointer"); - - darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, TRUE); + darwinTabletStylus = AddInputDevice(serverClient, DarwinTabletProc, FALSE); + assert(darwinTabletStylus); darwinTabletStylus->name = strdup("pen"); - darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, TRUE); + darwinTabletCursor = AddInputDevice(serverClient, DarwinTabletProc, FALSE); + assert(darwinTabletCursor); darwinTabletCursor->name = strdup("cursor"); - darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, TRUE); + darwinTabletEraser = AddInputDevice(serverClient, DarwinTabletProc, FALSE); + assert(darwinTabletEraser); darwinTabletEraser->name = strdup("eraser"); DarwinEQInit();