mgraesslin at kde.org
Fri Dec 12 21:56:08 GMT 2014
On Friday 12 December 2014 16:11:25 Thomas Lübking wrote:
> On Freitag, 12. Dezember 2014 08:00:45 CEST, Martin Gräßlin wrote:
> > I'd suggest to do a platform check as on Wayland it cannot work
> > (grab keyboard fails).
> You're certainly right in that the guarding is entirely superfluous on
> wayland, but grabbing still "works". Despite the platform window
> ::setKeyboardGrabEnabled() returns false for wayland, QWidget simply
> ignores that and assigns the grabber.
oh that's much better than I thought. I only knew that the QPA prints out
warnings like "not supported" so I expected that code would just break.
> What's worse: looking up the Qt code, QWidget only maintains the grabber as
> static variable, the grabbing state is never re-tested.
> Eeeewww... this is gonna be more complex, I fear.
Maybe one could say that misconfiguring the X-Server is out of scope. So if
it's grabbed it's assumed to stay grabbed.
> I wonder whether the grabbing state can actually be tested except by
> approaching a grab from a sidearm process. In doubt, the only possible
> hardening would be to continuously - and the only test whether it worked
> would be to invoke QWindow::setMouseGrabEnabled(bool grab) as well.
QWindow::setMouseGrabEnabled should be fine. The QXcbWindow implementation
looks properly to me, like actually checking whether the grab succeeded.
> Stay tuned ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: This is a digitally signed message part.
More information about the kde-core-devel