Busy cursor shows up even after HideCursor on MS-Windows

I found this problem on two Windows 7 computers I tested: even after HideCursor, the busy cursor will show up if we WaitSecs for more than 5 seconds. The following function (with explanation in comment) demonstrates the problem.


Screen version gives

     version: '3.0.15.517539408'

       build: 517539408

        date: 'Feb  7 2019'

          os: 'Microsoft Windows'

    language: 'Matlab 64-Bit'



Does anyone experience similar issue? Any workaround? Thanks.


-Xiangrui


=====================

   function test_win_cursor(keepFlipping)

w = Screen('OpenWindow',  max(Screen('Screens')), 127);

obj = onCleanup(@() sca); % close screen when done or error


DrawFormattedText(w, 'Cursor on', 'center', 'center', 0);

Screen('Flip', w);

% cursor will become busy after about 5 secs

WaitSecs('YieldSecs', 10);

DrawFormattedText(w, 'Cursor off', 'center', 'center', 0);

HideCursor;

t0 = Screen('Flip', w);


if nargin<1 || ~keepFlipping

    % busy cursor will show up after about 5 secs, even after HideCursor

    WaitSecs('YieldSecs', 10);

    return;

end


% if we keep flipping, no busy cursor shows up

while GetSecs<t0+10

    DrawFormattedText(w, 'Cursor off', 'center', 'center', 0);

    Screen('Flip', w);

    WaitSecs('YieldSecs', 0.1);

end


1 Like

I have the same problem now, did you manage to solve it?

This can be avoided by the trick used in KbWait.m. Just add the following line in the loop:

if IsWin, GetMouse; end