libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.38k stars 1.74k forks source link

Windows: custom cursors are displayed at a fixed size instead of the image's size. #5198

Closed slime73 closed 2 years ago

slime73 commented 2 years ago

On Windows, with SDL 2.0.18 or the latest git code (I've tested with both), custom cursors created with SDL_CreateColorCursor seem to render at a fixed size instead of the specified width and height. This appears to be a regression from at least some previous versions (I have also tested with a build of SDL 2.0.10 and it works - as well as the latest git code on macOS which works too).

I don't have a standalone C repro, but there is a repro/demo project using LÖVE, here: https://github.com/love2d/love/issues/1762

LÖVE can be downloaded here: https://github.com/love2d/love/releases (the project can be run with love by passing the zip file as a command line argument to love.exe, or dragging the zip onto the exe, or unzipping it into a folder and doing the prior steps with the folder instead of the zip).

LÖVE 11.4 uses SDL 2.0.18 on Windows, and 11.3 uses 2.0.10. You can also easily swap out the SDL2 dll to test different builds with that code.

slime73 commented 2 years ago

If I revert this change, the issue is fixed for me (although it probably reintroduces the problem that commit was meant to fix): https://github.com/libsdl-org/SDL/commit/301819cd1d7dac2d0e953a6f1780d234431d9f75

Again for reference, cursors are displayed at the image's size (perhaps scaled by a constant factor) on macOS for me, whereas in 2.0.18 on Windows every custom cursor is displayed at the same fixed size.

slime73 commented 2 years ago

cc @yufeih

slouken commented 2 years ago

This should be fixed, can you verify?

slime73 commented 2 years ago

It is fixed now, thanks!

slouken commented 2 years ago

Great, thanks!