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

Give focus to game on run #692

Open
DanielPri opened this issue Aug 2, 2024 · 3 comments
Open

Give focus to game on run #692

DanielPri opened this issue Aug 2, 2024 · 3 comments

Comments

@DanielPri
Copy link

Godot version

4.2.2.stable.official

VS Code version

1.92.0

Godot Tools VS Code extension version

2.1.0

System information

Windows 11

Problem statement

When running the game, focus is still on VS Code editor, requiring an Alt-tab to switch focus to the game.
Is it possible to optionally give focus to the game automatically? While a very small QoL feature, it would be very appreciated!
I could not find this setting in the command line documentation for godot, and yet when running directly from godot engine focus is given to the game.

Proposed solution

Optionally give focus to the game automatically upon run/run with debug.
Perhaps by using a powershell command?

@DaelonSuzuka
Copy link
Collaborator

When I hit F5 to launch the game, it opens on top of VSCode and is focused, UNLESS I interact with VSCode during the brief delay while the game is launching, in which case I get the behavior you're describing.

@sangold
Copy link

sangold commented Aug 4, 2024

It is weird, the run window used to behave like you described @DaelonSuzuka but I too now have the same issue. When hitting F5, the window does not pop into focus and stay behind. I tried to find what changed but couldn't find any changes on neither the project settings nor the vscode settings. The launch config looks standard:

"configurations": [
		{
			"name": "GDScript: Launch Project",
			"type": "godot",
			"request": "launch",
			"project": "${workspaceFolder}",
			"debug_collisions": false,
			"debug_paths": false,
			"debug_navigation": false,
			"additional_options": ""
		}
	]

I run into the issue on both 4.2.2 and I just tried 4.3 to see and still the same. TBH, not sure how much the plugin can solve this.

@DanielPri
Copy link
Author

For clarity, I do not interact with VSCode during the brief delay as it launches. (tried again a few more times to be sure)
Tried seeing if it behaves differently if running through F5, or by using mouse to navigate to the Run->Start Debugging option, and still the game launches without focus.
Although as sangold mentionned, there might not be a solution plugin-side.

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