diff --git a/pixelperfectengine/src/pixelperfectengine/concrete/windowhandler.d b/pixelperfectengine/src/pixelperfectengine/concrete/windowhandler.d index ea42c48..c632c9b 100644 --- a/pixelperfectengine/src/pixelperfectengine/concrete/windowhandler.d +++ b/pixelperfectengine/src/pixelperfectengine/concrete/windowhandler.d @@ -67,11 +67,17 @@ public class WindowHandler : InputListener, MouseListener, PopUpHandler { * Sets the cursor to the given type. */ public CursorType setCursor(CursorType type) { - cursor = type; - sdlCursor = SDL_CreateSystemCursor(cast(SDL_SystemCursor)cursor); - SDL_SetCursor(sdlCursor); + if (cursor != type) { + cursor = type; + sdlCursor = SDL_CreateSystemCursor(cast(SDL_SystemCursor)cursor); + SDL_SetCursor(sdlCursor); + } + } return cursor; } + /** + * Resets cursor to the default type. + */ public void resetCursor() { setCursor(CursorType.Arrow); }