On 19 September 2013 09:51, Gerd Hoffmann <kra...@redhat.com> wrote:
>> The documentation for qemu's input devices says:
>>
>> ‘tablet’
>> Pointer device that uses absolute coordinates (like a touchscreen).
>> This means qemu is able to report the mouse position without having to
>> grab the mouse. Also overrides the PS/2 mouse emulation when
>> activated.
>
> Note the "when activated".  When the guest starts talking to the usb
> tablet qemu will (a) switch from relative to absolute pointer mode and
> (b) start routing mouse events to the tablet instead of the ps/2 pointer
> device.
>
> So there is a phase at boot where qemu is in relative pointer mode and
> therefore does pointer grabs.  I think those grabs happen only on mouse
> clicks or hotkey (ctrl-alt grab/ungrab) though.
>
> You can watch 'info mice' in monitor to see when the switch happens.

I put printf statements in ui/sdl.c in sdl_grab_start() and _end(),
and entering the window with either tablet or wacom-tablet causes
those methods to be called and grabs taken.  To the user it doesn't
appear to be grabbed as the grab gets released when the pointer
reaches the edge, but the grab is still taken (and busy-loops if it
can't be taken successfully).

This isn't at boot time, this is with a Linux guest running X.

>> SDL has a rather stupid implementation of SDL_WM_GrabInput.  Grabs can
>> and do fail, but SDL decides to infinitely loop until the grab
>> succeeds.  If e.g. a screensaver is active when qemu starts up[1] then
>> qemu will busy-loop attempting to grab the pointer, potentially for a
>> long time and appearing to hang.
>
> Oops, that is stupid and should be fixed.
> As always, patches are very welcome.

Similar patches to SDL have been rejected before because it breaks the
API, so I don't see the bug in SDL getting resolved.

Ross

Reply via email to