Revision 455204eb hw/usb-hid.c
b/hw/usb-hid.c | ||
---|---|---|
39 | 39 |
int x, y; |
40 | 40 |
int kind; |
41 | 41 |
int mouse_grabbed; |
42 |
QEMUPutMouseEntry *eh_entry; |
|
42 | 43 |
} USBMouseState; |
43 | 44 |
|
44 | 45 |
/* mostly the same values as the Bochs USB Mouse device */ |
... | ... | |
259 | 260 |
int dx, dy, dz, b, l; |
260 | 261 |
|
261 | 262 |
if (!s->mouse_grabbed) { |
262 |
qemu_add_mouse_event_handler(usb_mouse_event, s, 0); |
|
263 |
s->eh_entry = qemu_add_mouse_event_handler(usb_mouse_event, s, |
|
264 |
0, "QEMU USB Mouse"); |
|
263 | 265 |
s->mouse_grabbed = 1; |
264 | 266 |
} |
265 | 267 |
|
... | ... | |
295 | 297 |
int dz, b, l; |
296 | 298 |
|
297 | 299 |
if (!s->mouse_grabbed) { |
298 |
qemu_add_mouse_event_handler(usb_tablet_event, s, 1); |
|
300 |
s->eh_entry = qemu_add_mouse_event_handler(usb_tablet_event, s, |
|
301 |
1, "QEMU USB Tablet"); |
|
299 | 302 |
s->mouse_grabbed = 1; |
300 | 303 |
} |
301 | 304 |
|
... | ... | |
503 | 506 |
{ |
504 | 507 |
USBMouseState *s = (USBMouseState *)dev; |
505 | 508 |
|
506 |
qemu_add_mouse_event_handler(NULL, NULL, 0);
|
|
509 |
qemu_remove_mouse_event_handler(s->eh_entry);
|
|
507 | 510 |
qemu_free(s); |
508 | 511 |
} |
509 | 512 |
|
Also available in: Unified diff