From f05155890611590cded558ae168e74f75e5725ac Mon Sep 17 00:00:00 2001 From: Stuart Bennett Date: Sun, 10 Aug 2008 22:31:53 +0100 Subject: xf86Cursors: xf86_reload_cursors shouldn't unconditionally show hwcursor (#14820) Also, no need to call ShowCursor when SetCursorPosition already does it Based on a previous patch by Maarten Maathuis --- hw/xfree86/modes/xf86Cursors.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index fee02df..7fb98bf 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 @@ -589,10 +590,17 @@ xf86_reload_cursors (ScreenPtr screen) xf86CursorInfoPtr cursor_info; CursorPtr cursor; int x, y; - + /* initial mode setting will not have set a screen yet */ if (!screen) return; + + /* return if HW cursor is inactive, to avoid displaying two cursors */ + xf86CursorScreenPtr ScreenPriv = dixLookupPrivate(&screen->devPrivates, + xf86CursorScreenKey); + if (!ScreenPriv->isUp) + return; + scrn = xf86Screens[screen->myNum]; xf86_config = XF86_CRTC_CONFIG_PTR(scrn); @@ -600,7 +608,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)) @@ -621,7 +629,6 @@ xf86_reload_cursors (ScreenPtr screen) (*cursor_info->LoadCursorImage)(cursor_info->pScrn, src); (*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y); - (*cursor_info->ShowCursor)(cursor_info->pScrn); } } -- 1.5.6