PaperWM icon indicating copy to clipboard operation
PaperWM copied to clipboard

Godot constantly refocuses itself

Open tmayoff opened this issue 1 year ago • 7 comments

Describe the bug When switching between windows, Godot always seems to refocus itself. This happens with the main godot editor then also when launching the game.

Godot is the only program I've experienced this with

To Reproduce I'm not sure if it's only godot causing this but

  1. Open Window 1 (anything, firefox or something)
  2. Open Godot
  3. Switch to window 1
  4. PaperWM scrolls back to godot

Expected behavior Should switch to Firefox and stay on firefox until keyboard shortcut/gesture to switch back

Screenshots Screencast from 2023-12-23 09-51-20.webm

System information: Please execute ./gather-system-info.sh in you PaperWM clone and paste the output below.

Distribution: NixOS
GNOME Shell 45.2
Display server: Wayland
PaperWM branch/tag: release
PaperWM commit: 6bead84704bf4db8fb7eb2ecd94bb1212059f7c3
Enabled extensions:
- [email protected]
- [email protected]
- blur-my-shell@aunetx
- [email protected]

Additional context A workaround for now seems to be to fullscreen the window (like double clicking the window's topbar), but it's tedious and annoying to have to do

tmayoff avatar Dec 23 '23 14:12 tmayoff

Thanks for reporting - yep, that would be annoying.

Any other applications this is happening on?

jtaala avatar Dec 24 '23 04:12 jtaala

Lastly, how was Godot installed? (distro repo or flatpak? or some other way?) - just going to try reproduce.

jtaala avatar Dec 24 '23 04:12 jtaala

Thanks @tmayoff - I can reproduce so will dig into this soon.

jtaala avatar Dec 24 '23 04:12 jtaala

You reproduced it already, but to answer the questions, seems to just be Godot that this is happening with, it was installed through nixpkgs on nixos

tmayoff avatar Dec 24 '23 04:12 tmayoff

Right, Godot seems to be doing some really funny stuff when it comes to focusing/defocusing (sometimes when another window gets focus, it toggles focus on godot windows).

Anyways, suspect this is an upstream godot issue, as other linux window managers are seeing this behaviour, see:

  • https://github.com/godotengine/godot/issues/68305 (see last comment from a few days ago)
  • https://github.com/godotengine/godot/issues/74378
  • https://github.com/godotengine/godot/issues/86438
  • https://github.com/godotengine/godot/issues/86442

Marking as upstream for now.

jtaala avatar Dec 24 '23 06:12 jtaala

I noticed some games doing the same but don't remember which exactly. I think it also depended on if it was fullscreen or not and if it was capturing the mouse or not. But I haven't had the same problem with any "normal" desktop apps.

Lythenas avatar Dec 24 '23 11:12 Lythenas

I have a similar problem with Spotify (flatpak). It randomly steals focus and PaperWM scrolls to it. A workaround is to send it to scratch.

nicolas-yangli avatar Jan 09 '24 12:01 nicolas-yangli