diff options
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 528f21e5..0b03cfae 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -3533,22 +3533,21 @@ sna_use_hw_cursor(ScreenPtr screen, CursorPtr cursor) struct sna *sna = to_sna_from_screen(screen); /* cursors are invariant */ - if (cursor == sna->cursor.ref) - return TRUE; - - cursor->refcnt++; - if (sna->cursor.ref) - FreeCursor(sna->cursor.ref, None); - sna->cursor.ref = cursor; - sna->cursor.size = __cursor_size(cursor); - sna->cursor.serial++; - - __DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__, - cursor->bits->width, - cursor->bits->height, - cursor->bits->argb!=NULL, - sna->cursor.serial, - sna->cursor.size)); + if (cursor != sna->cursor.ref) { + cursor->refcnt++; + if (sna->cursor.ref) + FreeCursor(sna->cursor.ref, None); + sna->cursor.ref = cursor; + sna->cursor.size = __cursor_size(cursor); + sna->cursor.serial++; + + __DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__, + cursor->bits->width, + cursor->bits->height, + cursor->bits->argb!=NULL, + sna->cursor.serial, + sna->cursor.size)); + } return sna->cursor.size <= sna->cursor.max_size; } |