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 grab focus when window is out of focus, even if tree is paused #62648

Open
atngames opened this issue Jul 2, 2022 · 2 comments
Open

Comments

@atngames
Copy link
Contributor

atngames commented Jul 2, 2022

Godot version

3.5 beta3

System information

linux

Issue description

I seem to have related issues:

  • when paused is true, buttons can grab focus or be hovered
  • when paused is true and another window has focus, buttons can still grab focus or be hovered
  • when paused is false and another window has focus, buttons can be pressed and emit signals (and still grab focus or be hovered)

The inputs to change focus or press buttons are made with a controller

Steps to reproduce

Launch the project, Alt-TAB to another window, make sure you can see the buttons below, use dpad to move through the buttons

Minimal reproduction project

test_paused_out_focus.zip

@Calinou
Copy link
Member

Calinou commented Jul 2, 2022

Can you reproduce this with keyboard inputs?

If not, this is done by design: #16832

Guard your Input.is_action_pressed()/event.is_action_pressed() checks with OS.is_window_focused() if you want to prevent this.

@atngames
Copy link
Contributor Author

atngames commented Jul 3, 2022

Hi, I understand the design while out of focus, thank you for the link.
I don't understand it while game is paused, though.

By the way, I don't understand how to guard the Inputs, since the movement is handled automatically by godot (like in the example above).

Thank you for your answer
Atn

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

No branches or pull requests

3 participants