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

Godot Editor Stealing Focus From Game #74587

Open
Orgull1972 opened this issue Mar 8, 2023 · 19 comments
Open

Godot Editor Stealing Focus From Game #74587

Orgull1972 opened this issue Mar 8, 2023 · 19 comments

Comments

@Orgull1972
Copy link

Godot version

4.0 Stable

System information

Windows 10

Issue description

After a game starts, the Godot Editor steals focus, sending keypresses to the editor, until I either Alt-Tab out and back into the game, or click with the mouse, anywhere in the window. (Fullscreen and Exclusive modes only)

Steps to reproduce

This happens in ALL my projects, even just now an empty test project I made, added a Character3D node, with the default movement controls, and the Character3D would not move until after I alt-Tabbed out and back in, OR until after I clicked somewhere in the window. All the keypresses I made before clicking appeared in the script editor.

I put print statements in all my input handlers in all my projects and confirmed that no keyboard inputs are ever registered until after an alt-tab or a click.

IMPORTANT: This issue does not happen with any other version of Godot, only 4.0 Stable. Input works perfectly in all previous versions, so I'm assuming it's not a hardware issue. This issue ONLY happens in Fullscreen and Exclusive Fullscreen modes and does not occur in Windowed modes. This issue happens in both Forward+ and Compatibilty mode.

Minimal reproduction project

project - Copy.zip

My current practice project (Trying out things that are different in Godot 4 for the first time, like CharacterBody3D)

@akien-mga
Copy link
Member

Assuming this is platform-specific as windowing issues often are (and I don't reproduce on Linux). CC @bruvzg

@venilark
Copy link

venilark commented Mar 9, 2023

I am pretty sure the error only happens if you disable Window>Size>Resizable, at least with Fullscreen/exclusive fullscreen, didn't test with the other modes. But even in that case, focus is lost for half a second (the times it decides to lose focus, it doesn't happen all the time).

@stuartfulton
Copy link

I had this problem consistently in Windows, and can confirm that re-enabling display/window/size/resizable fixes the issue.

@cj-33
Copy link

cj-33 commented Mar 13, 2023

Seeing a similar issue in Arch Linux with LXDE and the Godot IDE itself. alt-tabing from Godot IDE window will randomly not work and instead return focus to the Godot IDE instead of the target application window. This can be seen happening at 15 seconds and 25 seconds in the attached video. (Note, I first noticed this in xmonad which I normally use but I reproduced it in LXDE since that's less obscure). I've never seen this happen with any Godot 3.x versions (including 3.5.1) nor have I ever seen this with any other applications. It happens with any kind of application window (terminal, web browser,...)

VERSIONS:
Godot 4.0
xorg-server 21.1.7-1
libx11 1.8.4-1
lxde-common 0.99.2-3
linux 6.2.5.arch1-1
nvidia-open 525.89.02-10
xmonad 0.17.1-86 (not used in video demo, ignore this if not familiar)

godot4-window-focus-bug.mp4

@tribly
Copy link

tribly commented Mar 16, 2023

I have the same problem but with i3wm. Having godot on one workspace alone, and trying to switch to another workspace. But only when trying to use the hotkeys (win+$workspacenumber), not when clicking the workspaces in polybar.

Also, when opening another program on the same workspace:
godot.webm

Versions:
Godot 4.0
xorg-server 21.1.7-1
libx11 1.8.4-1
i3-wm 4.22-3
linux 6.2.2.arch1-1
nvidia 525.89.02-6

@stevenre3d
Copy link

Seeing this on Qtile as well. I have firefox fullscreen on one monitor and godot fullscreen on a 2nd monitor. If I click into the address bar on ff and start typing, everything goes to godot. If I toggle floating on the ff window and then try the same thing, it works normally again.

@ator-dev
Copy link
Contributor

ator-dev commented Apr 26, 2023

Same problem as @tribly , and has been happening for a long time in 4.x. Switching workspaces in Regolith (Ubuntu with out-of-the-box i3) is fine, but trying to switch to a tiled adjacent window is often impossible and requires actually creating a window specifically so that I can switch to it from the other direction. It seems to aggressively demand focus whenever it is even slightly resized by the window manager.

2023-04-26_21-16-05.mp4

All of the things I do in that capture - resizing various tiled windows, moving to a different 'tab' which causes borders to no longer be drawn around Godot - cause it to receive a resize signal by the wm. And that seems to be what tells it to aggressively pull back focus, to the point of making it impossible for me to switch to other windows in some cases.

Edit: Nevermind, just noticed the much-confirmed issue for this. I hope this can be sorted out at some point, unfortunately I don't have anywhere near the time to test it out in multiple wms 😕

@venilark
Copy link

venilark commented Dec 2, 2023

just happened to me right now, I was using WASD to move and nothing happened, then I left clicked and everything worked, went back to the editor and had "wadsdsdsdawwswdasw" written there
sometimes the keyboard works but not the mouse until I left click, maybe this is a different issue
4.1.3, Windows 10

@bkesecker
Copy link

Echoing @stuartfulton Grabbing focus once did not seem to help, nor repeatedly. Behavior outside the editor also seemed affected. Using version 4.2.

@gregkrsak
Copy link

Godot 4.2, Windows 10, Same issue. I have to left-click on my game first.

@Cequallium
Copy link

i am experiencing the same issue (focus stealing from all apps)
Versions:
Godot 4.2.1
Plasma 6.0.3 Wayland
linux 6.6.26

@darkhog
Copy link

darkhog commented May 10, 2024

Apparently it happens when "Resizeable" is unchecked in the project settings. #74619 has more info about it as well as a workaround. By the way, still an issue on 4.2.2.

@Vitorgus
Copy link

Same issue, but unlike #74619, my project had display/window/size/resizable checked. What worked for me was unckecking display/window/size/always_on_top.

System information: Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce MX130 (NVIDIA; 31.0.15.5222) - Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 Threads)

@Sebauxs
Copy link

Sebauxs commented Jul 29, 2024

Same issue here, I'm getting this logs:

platform/windows/display_server_windows.cpp:2572 - Parameter "hicon" is null.
 Failed to create Windows OS window.
 Failed to create sub window.
 scene/main/window.cpp:592 - Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
 platform/windows/display_server_windows.cpp:1313 - Condition "!windows.has(p_window)" is true. Returning: -1
 scene/main/window.cpp:592 - Condition "window_id == DisplayServer::INVALID_WINDOW_ID" is true.
 platform/windows/display_server_windows.cpp:1313 - Condition "!windows.has(p_window)" is true. Returning: -1

@Gr0minet
Copy link

Same problem. I have display/window/size/resizable checked and display/window/size/always_on_top disabled (both default).

System information:

Linux 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 GNU/Linux
Intel Core i7-8565U

Godot Engine v4.3.rc1.official.e343dbbcc - https://godotengine.org
Vulkan 1.3.230 - Forward+ - Using Device #0: Intel - Intel(R) UHD Graphics 620 (WHL GT2)

@OhiraKyou
Copy link

This also happens when the editor setting interface/editor/single_window_mode is set to true. However, that is required to avoid a freezing issue on save.

Player settings, for reference:

  • display/window/size/resizable is already set to true
  • display/window/size/always_on_top is false

Software:

  • Godot v4.3.stable - GLES3 (Compatibility)
  • Fedora Linux 40 (Workstation Edition) - Wayland

Raw system information paste:

Godot v4.3.stable - Fedora Linux 40 (Workstation Edition) - Wayland - GLES3 (Compatibility) - AMD Radeon RX 560 Series (radeonsi, polaris11, LLVM 18.1.6, DRM 3.57, 6.10.7-200.fc40.x86_64) - Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz (4 Threads)

@darkhog
Copy link

darkhog commented Sep 10, 2024

What I would know if it also happens after export, i.e. if the window that's opened right before you launch exported game will also steal focus. If it does that, something is wrong with the engine itself, if it only steals focus in the editor though, something is funky within the editor.

@mariomadproductions
Copy link

I have this issue with Linux Mint Cinnamon v20.3 and Godot v4.3. Project window settings are default apart from viewport width and height being set to smaller values and stretch mode set to viewport.

@mariomadproductions
Copy link

Assuming this is platform-specific as windowing issues often are (and I don't reproduce on Linux). CC @bruvzg

Could this have the linux platform tag added too? Or should a new issue be made for similar linux issues?

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