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

Game window loses focus on start, must left-click first to enable inputs #74619

Closed
venilark opened this issue Mar 8, 2023 · 5 comments
Closed
Labels

Comments

@venilark
Copy link

venilark commented Mar 8, 2023

Godot version

4.0

System information

Windows 10

Issue description

Sometimes when running a scene, the game loses focus, keyboard doesn't work and mouse events get ignored, you must left click to focus on the game window and start playing.

Steps to reproduce

Run the scene several times. Sometimes it will work just fine, others you will try to move with WASD or move the mouse and nothing will happen. Left click if that happens to "solve" the issue.
These are the settings for the Window.

imagen

Minimal reproduction project

focus.zip

@Orgull1972
Copy link

I'm having almost the identical issue. Reorted it in #74587 You're not alone!

@akien-mga
Copy link
Member

Duplicate of #74587

@akien-mga akien-mga marked this as a duplicate of #74587 Mar 9, 2023
@Wisdawms
Copy link

how fix this?

@Midrule
Copy link

Midrule commented Jan 16, 2024

Having "Resizeable" unchecked is what causes this. Turning it back on will make it focus on startup.

If you want to keep this a thing, have it unchecked by default then run this code in a ready function:
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_RESIZE_DISABLED, true)

@Nagasadri
Copy link

I had an issue where Windows' taskbar showed on top of the game on exclusive fullscreen mode, even after the player clicks on the window to give it focus.

Disabling "Resizeable" fixed that too.

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

No branches or pull requests

6 participants