Modesetting currently signals a failure to display the HW cursor by setting its size to 0 in drmmode_set_cursor(). xf86CursorSetCursor() will then detect that condition and switch to the SW cursor upon the next invokation.
The problem is that said invokation may not come before a while (i.e. before the cursor changes shape), and thus the user may be left with an invisible cursor for an undefined period of time. Therefore, check whether the HW cursor size has been set to 0 after calling xf86SetCursor(), and fall through the SW cursor fallback if this is the case in order to display the cursor immediately. Signed-off-by: Alexandre Courbot <[email protected]> --- hw/xfree86/ramdac/xf86Cursor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index c061b8028ca8..08868ffb2459 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -357,7 +357,15 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, ScreenPriv->isUp = TRUE; miPointerSetWaitForUpdate(pScreen, !infoPtr->pScrn->silkenMouse); - return; + + /* even if xf86SetCursor returns success, modesetting may + * have set the cursor size to 0 in order to switch to software + * cursor. If this happens, just fall through to switch to + * software cursor. If we don't do it here, the cursor will + * remain invisible until the next call to this function, which + * may not happen before a while */ + if (!(infoPtr->MaxWidth == 0 || infoPtr->MaxHeight == 0)) + return; } } -- 2.7.3 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
