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

Refactor timeout handling for GNOME 45 compatibility #26

Merged
merged 3 commits into from
Nov 27, 2023

Conversation

remulocosta
Copy link
Contributor

@remulocosta remulocosta commented Nov 20, 2023

Updated the timeout mechanism from Mainloop.timeout_add_seconds to GLib.timeout_add to ensure compatibility with GNOME 45. The refresh time is now multiplied by 200 to convert it into milliseconds, aligning with GLib.timeout_add's requirements for precise timing.

this.timeout = Mainloop.timeout_add_seconds(this.refreshTime, this.parseStat.bind(this));
this.timeout = GLib.timeout_add(
GLib.PRIORITY_DEFAULT,
this.refreshTime,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiply by 200 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multiplication by 200 was implemented to adjust the update interval, aiming to improve user experience. Originally, the update timing was set in such a way that the read or write values were updated too quickly, leading to unstable and sometimes uncomfortable viewing for the user.

These values often appeared and disappeared almost instantaneously, making it difficult to read and interpret the data in real-time. By adjusting the update interval to a slightly longer period (by multiplying by 200), we achieved an update rate that allows for a more stable and understandable display of values.

@biji biji merged commit e055e3e into biji:master Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants