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

[Bug]: Input lag using overlays on Linux #5044

Open
kwvanderlinde opened this issue Nov 12, 2024 · 3 comments
Open

[Bug]: Input lag using overlays on Linux #5044

kwvanderlinde opened this issue Nov 12, 2024 · 3 comments
Labels

Comments

@kwvanderlinde
Copy link
Collaborator

kwvanderlinde commented Nov 12, 2024

Describe the Bug

If any overlay - even a completely empty one - is open, dragging the map becomes extremely choppy to the point of being unuseable.

To Reproduce

  1. Open MapTool
  2. Run this command in chat: [r, overlay("test"): {}]
  3. Press the right mouse button and drag the map. The movement will be choppy.

Expected Behaviour

An empty overlay should not have a noticeable impact on input lag.

Screenshots

No response

MapTool Info

1.15.2

Desktop

Linux Minzt 22

Additional Context

No response

@kwvanderlinde
Copy link
Collaborator Author

Well, I was wrong about this being Linux-specific. It just so happens that I see it on my main (Linux) machine but not my Windows machine. I installed Windows on main machine and am seeing the same problem.

I've spent some time trying to diagnose this issue but haven't had much luck yet. All I know is that if overlays are passed events, then map drags become really laggy. Actually, I should say that rendering becomes laggy. I have a test case with an animated token that runs smoothly even with an overlay open until I start moving my mouse - then it becomes really choppy just like the map drags. So this is not an issue of input lag at all.

It doesn't seem to matter how the the overlay receives the events, just that it does. E.g., we currently use event filter, but I've also hacked in an alternative to let single overlays directly handle events. But the issue persists.

What's really strange is that our rendering itself isn't slow. There's just something else that seems to delay the results. I tried enabling opengl (-Dsun.java2d.opengl=true) which helped a lot but didn't complete solve the issue.

@cwisniew
Copy link
Member

Well, I was wrong about this being Linux-specific. It just so happens that I see it on my main (Linux) machine but not my Windows machine. I installed Windows on main machine and am seeing the same problem.

I've spent some time trying to diagnose this issue but haven't had much luck yet. All I know is that if overlays are passed events, then map drags become really laggy. Actually, I should say that rendering becomes laggy. I have a test case with an animated token that runs smoothly even with an overlay open until I start moving my mouse - then it becomes really choppy just like the map drags. So this is not an issue of input lag at all.

It doesn't seem to matter how the the overlay receives the events, just that it does. E.g., we currently use event filter, but I've also hacked in an alternative to let single overlays directly handle events. But the issue persists.

What's really strange is that our rendering itself isn't slow. There's just something else that seems to delay the results. I tried enabling opengl (-Dsun.java2d.opengl=true) which helped a lot but didn't complete solve the issue.

Would disabling event handling on the overlay while dragging the map and then enabling it afterwards help? Or its a more difficult problem than that? Hiding all overlays during map drag?

@kwvanderlinde
Copy link
Collaborator Author

Would disabling event handling on the overlay while dragging the map and then enabling it afterwards help? Or its a more difficult problem than that? Hiding all overlays during map drag?

It would help specifically for dragging the map in the presence of static overlays. It wouldn't help with other cases of noticeacble choppiness such as when another client drags a token (it's not completely smooth anyway, but it's bad when an overlay is involved). I also expect (but still need to test) than an overlay with any animation will result in the same choppiness, even without any user input.

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

No branches or pull requests

2 participants