qemu-devel
[Top][All Lists]
Advanced

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

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


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

Hi,

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.

However, qemu does do X pointer grabs when the pointer enters the
virtual display, but it rather cunningly detects the pointer reaching
the border of the display and ungrabs so there doesn't appear to be a
grab.  However, there's a "but".

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.

My understanding of X events has faded somewhat over the years but I
can't see why qemu needs to grab the pointer for absolute input
devices, and commenting out the grabs doesn't cause catastrophic
failures.  Is there a good reason why qemu grabs the pointer so much,
or can some/all of the grabs be removed?

Thanks,
Ross

[1] Our use-case is an automated test suite that runs inside qemu,
which is connected to a virtual X server that we can connect to if we
ever need to watch the test suite execute. Generally nobody is
connected, so there's no input, so the screensaver activates.



reply via email to

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