-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
High CPU usage when left mouse button is pressed #1322
Comments
Good find, I'm aware of this behavior, but didn't realize that cpu usage was so bad. This is due to how we implemented the scrolling while holding down the mouse button, we are basically repeating the mouse events to get the pane to scroll and update the text selection: zellij/zellij-client/src/stdin_handler.rs Lines 19 to 44 in 6822b9a
When these fake mouse events reach This second problem is easier to fix, we could for example modify the various For the root issue, not sure yet how solve this. |
Thanks for the explanation. Not sure if that is possible, but I feel it would be cleaner to not send any duplicate / fake events and let the server do the scrolling all by itself if it detects the mouse reaches the top / bottom border?
Do you feel we should separate the missing-mouseup problem into a new issue? |
Something like that would be great IMO, but it needs figuring out :)
Sure that would be great! |
You are right, this still happens without the repeater. There is an incorrect assumption that a click will always focus a pane and initiate selection, but that's not the case for plugin panes.
Yep, but as @raphCode said we are spamming apps with the synthetic events and that causes some other problems. |
Pressing and holding the left mouse button leads to 5-20% CPU usage in the zellij server and 1-3% in the client, depending on the machine and the process running inside zellij.
I can see that applications inside zellij are spammed with mouse escape sequences whenever zellij thinks the mouse button is down.
This happens even when not moving the mouse, whereas normally only cursor updates should be sent to the application.
This bug is particularly bad because in some cases zellij fails to detect the mouse-up event and continues burning CPU time whereas the physical mouse button is not even pressed anymore: #1334
I am using alacritty.
The text was updated successfully, but these errors were encountered: