Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11: Mouse button down not triggered subsequently after mouse button was only lifted while minimized. #3240

Closed
SDLBugzilla opened this issue Feb 11, 2021 · 1 comment

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.9
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2019-04-15 01:05:56 +0000, wrote:

I find unexpected behavior when having SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH enabled together with setting borderless window.

Steps to replicate:

  1. Make the SDL2 window borderless.
  2. Minimize the SDL2 window.
  3. Raise the SDL2 window.
  4. Click on another window to defocus. (I find this step is not needed on GNOME, but does on some other DE's)
  5. Click back in SDL2 window.

Upon clicking in the window in step 5, the expected behavior is that the click is registered and a SDL_MOUSEBUTTONDOWN event is sent, but it does not.

SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH works as expected otherwise.

On 2019-04-17 02:37:31 +0000, Sam Lantinga wrote:

I don't have a test setup to reproduce this, but tested patches are welcome!

On 2019-04-17 03:44:17 +0000, wrote:

I have done some more testing and I believe I understand the issue better now. My initial report was wrong.

Its not because of being borderless exactly, I see that is it caused by minimizing the window while the mouse button is held down. (Such as what happens when a program is drawing its own window controls.)

It seems SDL is excepting a SDL_MOUSEBUTTONUP before it will register another SDL_MOUSEBUTTONDOWN for a mouse button.

But a SDL_MOUSEBUTTONUP does not resister as the window is minimized.

Is this behavior a bug? And/or is there a way I can reset the events so a click down can be registered without subsequent click up?

On 2019-04-17 04:03:39 +0000, wrote:

Actually, I can workaround this issue by introducing a delay of about 80ms before using SDL_MinimizeWindow() after a click.

I notice this complication does not occur on Windows.

I don't mind if this bug report is closed now. I'm not sure if this is a valid bug or not. Apologies for the noise.

@slouken slouken removed the bug label May 11, 2022
@slouken
Copy link
Collaborator

slouken commented Nov 6, 2023

I believe this is fixed in the latest SDL release. Please feel free to reopen this if that's not the case.

@slouken slouken closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants