Bug 23034

Summary: FixesHideCursor is broken in X server git
Product: xorg Reporter: Peter Hutterer <peter.hutterer>
Component: Server/GeneralAssignee: Peter Hutterer <peter.hutterer>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: ThJaeger
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
GTK test program displaying an animated cursor.
none
Simple X program calling XFixesHide/ShowCursor
none
0001-xfixes-backup-the-DisplayCursor-CloseScreen-proc-bef.patch none

Description Peter Hutterer 2009-07-29 23:55:19 UTC
Created attachment 28183 [details]
GTK test program displaying an animated cursor.

Three broken cases identified, possibly linked to the same cause. Test
programs are attached. Busycursor is a gtk program that displays an animated
cursor (in the default Fedora GNOME theme anyway), hidecursor just calls
XFixesHideCursor/XFixesShowCursor until cancelled.

Test case 1:
1. run busycursor, click button, leave cursor in busycursor window
2. open terminal, run hidecursor while cursor is still in busycursor
3. ctrl+c hidecursor until exit
4. ctrl+c busycursor

Server crashes, but it seems to happen in different cases. Looks like some
cursor reference is still around after the cursor got freed.

Test case 2:
1. repeat steps 1 - 3 from above

The cursor is now animated everywhere, not just in the window.

Test case 3:
1. run busycursor, click button, move cursor outside of busycursor window
2. run hidecursor, ctrl+c hidecursor

Moving the cursor back into the busycursor window won't display a cursor at
all.
Comment 1 Peter Hutterer 2009-07-29 23:56:57 UTC
Created attachment 28184 [details]
Simple X program calling XFixesHide/ShowCursor
Comment 2 Peter Hutterer 2009-07-30 23:06:44 UTC
Created attachment 28214 [details] [review]
0001-xfixes-backup-the-DisplayCursor-CloseScreen-proc-bef.patch

The screen's DisplayCursor func is wrapped as
AnimCurDisplayCursor -> CursorDisplayCursor -> miPointerDisplayCursor.

Calling CursorDisplayCursor while an animated cursor was currently displayed
would remove AnimCurDisplayCursor from the wrap stack. Thus, the next call
to ChangeToCursor wouldn't update the animated cursor state. The block
handler for animated cursors would then continuously overwrite the actual
cursor, leaving an animated cursor everywhere on the screen.
Comment 3 Peter Hutterer 2009-08-02 19:45:49 UTC
pushed as 664ac92d8bbe956dd6fd80fac5dc3161028803b2

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.