wacom tablet: activate event handlers.
Add qemu_activate_mouse_event_handler() calls to the usb wavom tablet so it actually receives events. Also make sure we only remove the handler if we registered it before. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
cd49692615
commit
b2d4d83299
@ -160,6 +160,7 @@ static int usb_mouse_poll(USBWacomState *s, uint8_t *buf, int len)
|
|||||||
if (!s->mouse_grabbed) {
|
if (!s->mouse_grabbed) {
|
||||||
s->eh_entry = qemu_add_mouse_event_handler(usb_mouse_event, s, 0,
|
s->eh_entry = qemu_add_mouse_event_handler(usb_mouse_event, s, 0,
|
||||||
"QEMU PenPartner tablet");
|
"QEMU PenPartner tablet");
|
||||||
|
qemu_activate_mouse_event_handler(s->eh_entry);
|
||||||
s->mouse_grabbed = 1;
|
s->mouse_grabbed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,6 +198,7 @@ static int usb_wacom_poll(USBWacomState *s, uint8_t *buf, int len)
|
|||||||
if (!s->mouse_grabbed) {
|
if (!s->mouse_grabbed) {
|
||||||
s->eh_entry = qemu_add_mouse_event_handler(usb_wacom_event, s, 1,
|
s->eh_entry = qemu_add_mouse_event_handler(usb_wacom_event, s, 1,
|
||||||
"QEMU PenPartner tablet");
|
"QEMU PenPartner tablet");
|
||||||
|
qemu_activate_mouse_event_handler(s->eh_entry);
|
||||||
s->mouse_grabbed = 1;
|
s->mouse_grabbed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,8 +336,10 @@ static int usb_wacom_handle_control(USBDevice *dev, int request, int value,
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
case WACOM_SET_REPORT:
|
case WACOM_SET_REPORT:
|
||||||
qemu_remove_mouse_event_handler(s->eh_entry);
|
if (s->mouse_grabbed) {
|
||||||
s->mouse_grabbed = 0;
|
qemu_remove_mouse_event_handler(s->eh_entry);
|
||||||
|
s->mouse_grabbed = 0;
|
||||||
|
}
|
||||||
s->mode = data[0];
|
s->mode = data[0];
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
@ -397,7 +401,10 @@ static void usb_wacom_handle_destroy(USBDevice *dev)
|
|||||||
{
|
{
|
||||||
USBWacomState *s = (USBWacomState *) dev;
|
USBWacomState *s = (USBWacomState *) dev;
|
||||||
|
|
||||||
qemu_remove_mouse_event_handler(s->eh_entry);
|
if (s->mouse_grabbed) {
|
||||||
|
qemu_remove_mouse_event_handler(s->eh_entry);
|
||||||
|
s->mouse_grabbed = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int usb_wacom_initfn(USBDevice *dev)
|
static int usb_wacom_initfn(USBDevice *dev)
|
||||||
|
Loading…
Reference in New Issue
Block a user