From patchwork Fri Aug 27 14:44:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 62860 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 36857B710B for ; Sat, 28 Aug 2010 01:06:06 +1000 (EST) Received: from localhost ([127.0.0.1]:33664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Op0AE-0007kb-GT for incoming@patchwork.ozlabs.org; Fri, 27 Aug 2010 10:44:18 -0400 Received: from [140.186.70.92] (port=49401 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Op09V-0007jH-7s for qemu-devel@nongnu.org; Fri, 27 Aug 2010 10:43:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Op09P-0002Wp-UT for qemu-devel@nongnu.org; Fri, 27 Aug 2010 10:43:32 -0400 Received: from smtp.ctxuk.citrix.com ([62.200.22.115]:60046 helo=SMTP.EU.CITRIX.COM) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Op09P-0002Vs-Pv for qemu-devel@nongnu.org; Fri, 27 Aug 2010 10:43:27 -0400 X-IronPort-AV: E=Sophos;i="4.56,278,1280707200"; d="scan'208";a="1583231" Received: from lonpmailmx01.citrite.net ([10.30.224.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 27 Aug 2010 14:43:27 +0000 Received: from kaball.uk.xensource.com (10.80.2.59) by smtprelay.citrix.com (10.30.224.162) with Microsoft SMTP Server id 8.2.254.0; Fri, 27 Aug 2010 15:43:24 +0100 Date: Fri, 27 Aug 2010 15:44:02 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball-desktop To: "qemu-devel@nongnu.org" Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: John Haxby , Stefano Stabellini Subject: [Qemu-devel] [PATCH 2 of 2] Move the xenfb pointer handler to the connected method X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: John Haxby Move the xenfb pointer handler to the connected method Ensure that we read "request-abs-pointer" after the frontend has written it. This means that we will correctly set up an ansolute or relative pointer handler correctly. Signed-off-by: John Haxby Signed-off-by: Stefano Stabellini diff --git a/hw/xenfb.c b/hw/xenfb.c index b535d8c..72e5277 100644 --- a/hw/xenfb.c +++ b/hw/xenfb.c @@ -364,19 +364,27 @@ static int input_initialise(struct XenDevice *xendev) struct XenInput *in = container_of(xendev, struct XenInput, c.xendev); int rc; - if (xenstore_read_fe_int(xendev, "request-abs-pointer", - &in->abs_pointer_wanted) == -1) - in->abs_pointer_wanted = 0; - rc = common_bind(&in->c); if (rc != 0) return rc; qemu_add_kbd_event_handler(xenfb_key_event, in); + return 0; +} + +static void input_connected(struct XenDevice *xendev) +{ + struct XenInput *in = container_of(xendev, struct XenInput, c.xendev); + + if (xenstore_read_fe_int(xendev, "request-abs-pointer", + &in->abs_pointer_wanted) == -1) + in->abs_pointer_wanted = 0; + + if (in->qmouse) + qemu_remove_mouse_event_handler(in->qmouse); in->qmouse = qemu_add_mouse_event_handler(xenfb_mouse_event, in, in->abs_pointer_wanted, "Xen PVFB Mouse"); - return 0; } static void input_disconnect(struct XenDevice *xendev) @@ -956,6 +964,7 @@ struct XenDevOps xen_kbdmouse_ops = { .size = sizeof(struct XenInput), .init = input_init, .initialise = input_initialise, + .connected = input_connected, .disconnect = input_disconnect, .event = input_event, };