From patchwork Wed Jul 21 13:46:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 59441 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 3679CB6EF2 for ; Wed, 21 Jul 2010 23:47:17 +1000 (EST) Received: from localhost ([127.0.0.1]:49132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObZdh-0007YR-F6 for incoming@patchwork.ozlabs.org; Wed, 21 Jul 2010 09:47:13 -0400 Received: from [140.186.70.92] (port=38369 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObZcQ-0007XI-MN for qemu-devel@nongnu.org; Wed, 21 Jul 2010 09:45:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObZcL-0000nS-GC for qemu-devel@nongnu.org; Wed, 21 Jul 2010 09:45:54 -0400 Received: from smtp.eu.citrix.com ([62.200.22.115]:7220) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObZcL-0000mr-Al for qemu-devel@nongnu.org; Wed, 21 Jul 2010 09:45:49 -0400 X-IronPort-AV: E=Sophos;i="4.55,238,1278288000"; d="scan'208";a="1001977" Received: from lonpmailmx01.citrite.net ([10.30.224.162]) by LONPIPO01.EU.CITRIX.COM with ESMTP/TLS/RC4-MD5; 21 Jul 2010 13:45:48 +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; Wed, 21 Jul 2010 14:45:48 +0100 Date: Wed, 21 Jul 2010 14:46:30 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball-desktop To: 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] 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, };