Sorry, I just spend on this a while (and even found that thread on the xorg mailinglist), but I don't know how to change that cleanly in 1.7 without changing interfaces (which I can't do in 1.7). The problem with your second solution is that it would break the mouse when someone stops the timer (or does not call device->run() at all - which is something you also need in some applications). And stopping the timer is common thing.
The only clean way I see right now for a workaround is adding a function to ICursorControl to set the update/cache behavior for cursors. Which means I have to change it in trunk. It's ugly to have this in 1.7.3, but well - as soon as that is out we're working on finishing 1.8, so won't be too long in there.
Workaround here for now is probably using a custom camera which buffers the cursor position.
(Btw also couldn't fix a cursor-problem on Windows for other reasons - not such a successful Monday for me)
[fixed in 1.8] Overuse of XQueryPointer (linux)
Re: [bug, patch] Overuse of XQueryPointer (linux)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: [bug, patch] Overuse of XQueryPointer (linux)
Finally got to working on this again... there is now a new function in ICursorControl to set platform specific behavior for cursors in svn trunk (r4251).
To enable the workaround from your patch call for example:
Also a link to that thread that had the reason for this trouble: http://www.spinics.net/lists/xorg/msg53506.html
As far as I can see this is not yet fixed in X11, guess they are just as slow as I am ;-)
Unfortunately I see no way to fix this in 1.7 as my patch needs an interface change and your patch can break existing code.
Also not really the nicest patch as the problem still can occur - just way less often now. Maybe we really need XCB as people there proposed.
To enable the workaround from your patch call for example:
Code: Select all
IrrlichtDevice * device = createDevice(video::EDT_OPENGL, core::dimension2d<u32>(640, 480));
gui::ICursorControl * cursor = device->getCursorControl ();
cursor->setPlatformBehavior(gui::ECPB_X11_CACHE_UPDATES);
As far as I can see this is not yet fixed in X11, guess they are just as slow as I am ;-)
Unfortunately I see no way to fix this in 1.7 as my patch needs an interface change and your patch can break existing code.
Also not really the nicest patch as the problem still can occur - just way less often now. Maybe we really need XCB as people there proposed.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm