godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.68k stars 20.79k forks source link

Unfocusing game window causes the FPS to drop to 1 when v-sync is enabled and SwayWM/Wayland is used #44741

Open poperigby opened 3 years ago

poperigby commented 3 years ago

Godot version: 3.2.3

OS/device including version: OS: Arch Linux Window Manager: Sway GPU: RX 5700 XT CPU: Ryzen 7 3700X Backend: GLES3

Issue description: With an empty scene, when I unfocus the game's window, the FPS will drop down to 1. Refocusing the window causes the FPS to climb back up to 60. If I disable v-sync, the problem seems to disappear. This problem only seems to happen on SwayWM, because running the scene with GNOME didn't reproduce the problem.

Steps to reproduce:

  1. Create an empty scene
  2. Print Engine.get_frames_per_second() within physics_process
  3. Unfocus the window

Minimal reproduction project:

MinimalReproductionProject.zip

Video

https://user-images.githubusercontent.com/20866468/103185353-e1659500-4870-11eb-860b-312b624a8d37.mp4

poperigby commented 3 years ago

This might have something to do with XWayland https://gitlab.freedesktop.org/xorg/xserver/-/issues/1099