SDL icon indicating copy to clipboard operation
SDL copied to clipboard

SDL3, POPUP windows. mouse captured by wrong window.

Open c-smile opened this issue 4 months ago • 0 comments

When popup window is shown without setting keyboard focus on it, SDL_UpdateMouseCapture sets capture to wrong window - not to the popup window as it should.

This leads to mouse handling problems on popups. For example SDL_EVENT_MOUSE_BUTTON_UP is not delivered to the popup.

I suspect that this line

capture_window = SDL_GetKeyboardFocus();

shall be replaced by

capture_window = mouse->focus;

keyboard focus window is not always the one that contains the mouse.

Think about popup window of combobox (dropdown select), or a menu. Such popups do not have input (keyboard) focus.

c-smile avatar Feb 02 '24 21:02 c-smile