SDL 2.0.22 PRERELEASE

Just a thought: I wonder if a simple fix would be to make SDL_SetCursor() release the mouse capture before changing the cursor shape.

What is your app? Can I try it here for debugging?

What is the use case where youā€™re dragging the mouse out of the window and need the cursor to change over the title bar?

Itā€™s the Windows edition that shows the problem here, hereā€™s the download link. Extract the contents of the zip to an empty directory, replace the supplied SDL2.dll (which is 2.0.20) with the 32-bit 2.0.22 and run bbcsdl.exe.

You will initially be presented with a choice of IDE, you should select SDLIDE from the options given. Now try moving the mouse around: the cursor will change from an I-beam over the editing pane to an arrow over the toolbar.

To repro the issue click in the editing pane (which I assume will cause the mouse to be captured in 2.0.22) and repeat the movement: now you should find that it doesnā€™t change shape even when over the title bar.

Iā€™ve made a video so you can see exactly whatā€™s happening:

I put the SDL_SetCursor thing in a bug report:

It sounds like for your application you donā€™t want the auto capture behavior.

You can disable it with:
SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "0");

On the contrary, auto capture behavior would be great (Iā€™m used to having it in native Windows apps) and is helpful in tracking mouse movements beyond the edge of the window. Currently (with 2.0.20) I have to tell my users that this doesnā€™t work.

I just want to be able to change the cursor shape as the mouse moves, which should (surely?) be independent of the capture behavior.

There seems to be a related regression in connection with the close button in the title bar (in Windows, anyway). Iā€™m finding that if I first click in SDLā€™s window, then click on the close button, nothing happens except that the close button is highlighted. I must then click on close a second time to actually quit the app.

Both this and the previously-reported regression suggest that when the mouse is captured, normal non-client-area operations (moving over or clicking on the title bar) are not happening.

i also observe this problem on sdl with asan, but the question is i do not understand why you said sanitizer would crash. on every call of scandir, INTERCEPTOR() would set the filter based on the call. if filter = null, the scandir call is called with null.

int res =
REAL(scandir64)(dirp, namelist,
filter ? wrapped_scandir64_filter : nullptr,
compar ? wrapped_scandir64_compar : nullptr);

so how exactly would it cause the sanitizer to crash?