diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 57cfcb6..f3e3ed9 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -45,6 +45,7 @@ #include "picturestr.h" #endif #include "cursorstr.h" +#include "../ramdac/xf86CursorPriv.h" /* * Given a screen coordinate, rotate back to a cursor source coordinate @@ -594,10 +595,24 @@ xf86_reload_cursors (ScreenPtr screen) xf86CursorInfoPtr cursor_info; CursorPtr cursor; int x, y; - + xf86CursorScreenPtr ScreenPriv; + /* initial mode setting will not have set a screen yet */ if (!screen) return; + + ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate( + &screen->devPrivates, xf86CursorScreenKey); + + /* + * Return if HW cursor is inactive (a HWCursor can still be forced on). + * Only return if we don't have a saved cursor + no current cursor (this would be a modeset). + */ + if (ScreenPriv->SWCursor && !ScreenPriv->HWCursorForced && + !((ScreenPriv->CurrentCursor == NullCursor) && + (ScreenPriv->SavedCursor != NullCursor))) + return; + scrn = xf86Screens[screen->myNum]; xf86_config = XF86_CRTC_CONFIG_PTR(scrn); @@ -605,7 +620,7 @@ xf86_reload_cursors (ScreenPtr screen) cursor_info = xf86_config->cursor_info; if (!cursor_info) return; - + cursor = xf86_config->cursor; GetSpritePosition (&x, &y); if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))