qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Why X grabs for absolute windows?


From: Burton, Ross
Subject: Re: [Qemu-devel] Why X grabs for absolute windows?
Date: Thu, 19 Sep 2013 10:46:15 +0100

On 19 September 2013 09:51, Gerd Hoffmann <address@hidden> 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

[Prev in Thread] Current Thread [Next in Thread]