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

Keyboard repeat lag on GNOME #31177

Closed
kkga opened this issue Aug 7, 2019 · 6 comments · Fixed by #41910
Closed

Keyboard repeat lag on GNOME #31177

kkga opened this issue Aug 7, 2019 · 6 comments · Fixed by #41910

Comments

@kkga
Copy link

kkga commented Aug 7, 2019

Godot version:
3.1.1 stable, also happens on 3.2 dev

OS/device including version:
OS: Linux, Fedora 30, GNOME 3.32.2
GPU: Intel UHD 620

Issue description:
When using the script editor on GNOME desktop, the response to keyboard repeat is “lagging”.
It’s difficult to illustrate with a GIF, but simply put: if you hold a key (e.g. arrow down to scroll) and then release it, the release triggers not immediately but after a certain lag.
Response to initial keystroke is immediate, so the lag only happens on keyboard repeat, i.e. when holding a key.

This happens only on GNOME, both when running on Wayland and Xorg.
I’ve tested on i3 and Sway: the problem disappears.

Adjusting keyboard repeat rate in GNOME also affects this issue but doesn’t solve it: higher repeat rate makes the lag in Godot longer. So if I have a very high repeat rate, Godot might keep “firing” the repeated keystroke for over ~2sec after I release the key.

To exclude the possibility that it's specific to my machine and OS setup, I’ve also tested and confirmed the issue on a spare laptop with a clean install of Fedora 29.

@kkga
Copy link
Author

kkga commented Aug 7, 2019

After some more experimenting found that the lag is directly tied to my screen resolution, as I'm using a 4k display: if I switch the resolution to 1440p or 1080p -- the lag disappears.

UPD: another observation: resizing the window to something smaller than fullscreen also fixes the issue, even on 4k resolution.

@Calinou
Copy link
Member

Calinou commented Aug 7, 2019

@kkga What framerate do you get in the editor? You can start the Godot binary with --print-fps command-line argument to print the FPS continuously to standard output. Note that this setting isn't passed to the editor when starting the project manager, so you will have to edit a project directly by specifying a path to a project.godot file:

/path/to/godot.binary ~/Documents/Godot/some_project/project.godot --print-fps

If the framerate is too low, not much can be done about it, except disabling V-Sync in the Project Settings (which will also impact the editor after restarting it). We could add support for adaptive V-Sync in the long term, so that low FPS won't increase input lag and stuttering as much.

@kkga
Copy link
Author

kkga commented Aug 8, 2019

The framerate is really bad :/

This is with V-sync turned off.

Here's what it's like when navigating the script editor in fullscreen:
Peek 2019-08-08 12-14

The only way to get a usable framerate is to resize the window to something like this:
Peek 2019-08-08 12-16


As I mentioned before, I'm only experiencing such performance drop on GNOME.

@Calinou
Copy link
Member

Calinou commented Aug 8, 2019

As I mentioned before, I'm only experiencing such performance drop on GNOME.

GNOME's compositing window manager likely doesn't help with rendering performance… This is why you get better performance in a window manager with compositing disabled 😉

Still, it will likely improve when text batching is implemented (see #19917).

@KoBeWi
Copy link
Member

KoBeWi commented Sep 17, 2020

Can anyone still reproduce this bug in Godot 3.2.3 or any later release?

@kkga
Copy link
Author

kkga commented Sep 18, 2020

I have a discrete GPU now, so I can't really test under the same conditions.

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

Successfully merging a pull request may close this issue.

4 participants