From: John Haxby <john.haxby@oracle.com>
To: xen-devel@lists.xensource.com
Cc: John Haxby <john.haxby@oracle.com>
Subject: [PATCH 2/2] Move the xenfb pointer handler to the connected method
Date: Wed, 7 Jul 2010 14:40:02 +0100 [thread overview]
Message-ID: <1278510002-20735-3-git-send-email-john.haxby@oracle.com> (raw)
In-Reply-To: <1278510002-20735-1-git-send-email-john.haxby@oracle.com>
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 <john.haxby@oracle.com>
---
hw/xenfb.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/hw/xenfb.c b/hw/xenfb.c
index c96cfe6..29a873f 100644
--- a/hw/xenfb.c
+++ b/hw/xenfb.c
@@ -366,19 +366,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)
@@ -958,6 +966,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,
};
--
1.7.1
next prev parent reply other threads:[~2010-07-07 13:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-07 13:40 [Patch 0/2] Fix request-abs-pointer (again) John Haxby
2010-07-07 13:40 ` [PATCH 1/2] Introduce a new 'connected' xendev op called when Connected John Haxby
2010-07-07 16:40 ` Stefano Stabellini
2010-07-07 13:40 ` John Haxby [this message]
2010-07-07 16:41 ` [PATCH 2/2] Move the xenfb pointer handler to the connected method Stefano Stabellini
2010-07-07 15:55 ` [Patch 0/2] Fix request-abs-pointer (again) Konrad Rzeszutek Wilk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1278510002-20735-3-git-send-email-john.haxby@oracle.com \
--to=john.haxby@oracle.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).