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

Button can still be clicked if overlapped with another control with MOUSE_FILTER_STOP if the user does not release mouse button(-s) #93395

Closed
smedelyan opened this issue Jun 20, 2024 · 5 comments · Fixed by #93500

Comments

@smedelyan
Copy link

smedelyan commented Jun 20, 2024

Tested versions

  • Reproducible in v4.2.2.stable.official [15073afe3]

System information

Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1660 (NVIDIA; 31.0.15.3623) - AMD Ryzen 7 2700X Eight-Core Processor (16 Threads)

Issue description

I have a number of GUI-s. When I click on a button, it opens a fullscreen blocking GUI (mouse_filter = STOP). However, it seems to be still possible to press this initial button, even if it is completely blocked by the GUI (any control with MOUSE_FILTER_STOP).

A workaround would be to always check is_hovered first, however, the button UI will display presses anyway. If you want to NOT display clicks at all, you will need your own button...

I'm not sure about the severity of the issue, but in some projects this may mean that Godot's buttons should never be used at all (or disable styles, textures, etc. to never let it display clicks), and instead you should always use your own buttons.

Steps to reproduce

  1. Launch project
  2. Press the Click me button with RIGHT or MIDDLE mouse button. Hold it (don't release!)
  3. Now click the button with LEFT mouse button. Keep the RIGHT / MIDDLE button pressed
  4. The panel pops up and blocks the button. Keep the RIGHT / MIDDLE button pressed
  5. While still holding the RIGHT / MIDDLE button down, start clicking LEFT mouse button multiple times.
  6. Panel lets the clicks come through to the button. This should NOT happen.

p.6 won't happen if you don't hold RIGHT / MIDDLE button at p.2
If you try the steps above with check_is_hovered = true (property on click_me_button.gd), you will see that the behavior is mainly valid (except that button UI still displays clicks)

Minimal reproduction project (MRP)

button_mrp.zip

@smedelyan
Copy link
Author

One small update is that while you hold RIGHT / MIDDLE button (p.2) no other control can receive clicks as they all get consumed by this button

@anniryynanen
Copy link
Contributor

Also reproduces in v4.3.beta2.official [b75f048]. I'll take a look, maybe I can fix it.

@anniryynanen
Copy link
Contributor

This also works:

  • Press right down on the button, hold it
  • Move mouse off the button
  • While still holding right, click with the left
  • Button emits pressed

That probably shouldn't happen.

I'm guessing it's ok that you can't click other buttons while holding down a button from elsewhere, but it shouldn't click the original button either.

@smedelyan
Copy link
Author

@anniryynanen thank you for the quick reply! Do you think this one is easy enough to get fixed - and maybe even shipped in 4.3?

@anniryynanen
Copy link
Contributor

Shouldn't be a problem as long as someone has time to review it, I found a simple enough solution for the presses. I'm still trying to fix the button staying hovered when the panel opens and mouse is still holding something down... but it's less important so I won't spend too much time on it. The hover disappears on the next mouse button or move event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants