diff --git a/changes.txt b/changes.txt index 1e021bbe..0e1abae7 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,9 @@ -------------------------- Changes in 1.9 (not yet released) +- ICursorControl::isVisible is now always returning the flag set in setVisible. + This changes the behaviour on Win32 somewhat when Windows returned a CURSOR_SUPPRESSED state (touch-screen input). + Previously we set IsVisible it to false when CURSOR_SUPPRESSED was set. + Also we handle the CURSOR_SUPPRESSED state slightly different now and still try to hide cursors once when requested. - Improvements to B3D writer for speed, readability and handling of low framerate animations. Thanks @JLouisB for the patch (For more info, see: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=50067&start=15) - Add another render pass ESNRP_GUI which is drawn last and is p.E. useful for rendering gui nodes in the scenemanager. diff --git a/include/ICursorControl.h b/include/ICursorControl.h index 4597bf37..13c99c45 100644 --- a/include/ICursorControl.h +++ b/include/ICursorControl.h @@ -104,7 +104,7 @@ namespace gui virtual void setVisible(bool visible) = 0; //! Returns if the cursor is currently visible. - /** \return True if the cursor is visible, false if not. */ + /** \return True if the cursor flag is set to visible, false if not. */ virtual bool isVisible() const = 0; //! Sets the new position of the cursor. diff --git a/source/Irrlicht/CIrrDeviceWin32.h b/source/Irrlicht/CIrrDeviceWin32.h index b32da282..9e64a13e 100644 --- a/source/Irrlicht/CIrrDeviceWin32.h +++ b/source/Irrlicht/CIrrDeviceWin32.h @@ -148,11 +148,9 @@ namespace irr while ( gotCursorInfo ) { #ifdef CURSOR_SUPPRESSED - // new flag for Windows 8, where cursor - // might be suppressed for touch interface - if (info.flags == CURSOR_SUPPRESSED) + // Since Windows 8 the cursor can be suppressed by a touch interface + if (visible && info.flags == CURSOR_SUPPRESSED) { - visible=false; break; } #endif @@ -173,6 +171,16 @@ namespace irr // yes, it really must be set each time info.cbSize = sizeof(CURSORINFO); gotCursorInfo = GetCursorInfo(&info); + +#ifdef CURSOR_SUPPRESSED + // Not sure if a cursor which we tried to hide still can be suppressed. + // I have no touch-display for testing this and MSDN doesn't describe it. + // But adding this check shouldn't hurt and might prevent an endless loop. + if (!visible && info.flags == CURSOR_SUPPRESSED) + { + break; + } +#endif } IsVisible = visible; }