SetCursor doesn't work outside the window with mouse captured


#1

Hello,
I’m using SDL 2.0.9 on Windows 10 (64 bits) and in my application I want to implement dragging in a text area, which may involve having an IBEAM cursor, even if the mouse goes outside the window while dragging.

I called SDL_CaptureMouse when the mouse button is down, and then I use SDL_SetCursor when the mouse moves with SDL_MOUSEMOTION. This works as long as my mouse is inside the window, but as soon as it gets out, it reverts back to a default cursor… I expected the cursor to stay the one I set, because I am capturing it, and I even see it flicker as I keep setting it, but it looks like something else tries to constantly set it back to either resizing cursors around the SDL window, or the default arrow Oo

Could this be a bug?

My project is quite large to be posted here so here is a quick redux of what my event processing looks like:

	switch(event.type) {

	case SDL_MOUSEBUTTONDOWN:
		SDL_CaptureMouse(SDL_TRUE);
		break;

	case SDL_MOUSEBUTTONUP:
		SDL_CaptureMouse(SDL_FALSE);
		break;

	case SDL_MOUSEMOTION:
		SDL_SetCursor(_ibeam_cursor);
		break;
}