fflewddur / tophat

View CPU, memory, disk, and network activity in the GNOME top bar.
https://extensions.gnome.org/extension/5219/tophat/
GNU General Public License v3.0
347 stars 26 forks source link

Top Bar Icons Float to the Right After Resuming from Suspend #103

Open golamrabbiazad opened 1 year ago

golamrabbiazad commented 1 year ago

When my computer wakes up from suspend mode, I've noticed a recurring problem with the extension. Despite my system settings being configured to display the top bar icons on the left side, they consistently shift to the right side of the top bar after resuming from suspend. This behavior is unexpected and contrary to my preferred layout.

For example, A picture of the issue would be more understandable. topbar-icon-float-to-the-right

The extension position should be on the left side and the other icons on the right side. I have configured this on the shell settings but resuming from suspend makes reset the configuration.

If any additional information or logs are needed to diagnose the problem, please let me know and I'll be happy to provide them.

golamrabbiazad commented 1 year ago

I have figured out this issue and found a hard-coded solution. The TopHat extension mounts early before all other GNOME shell extensions are loaded. This issue is valid when the TopHat extension position is on the "RIGHT" side. We don't need to worry about other mount positions.

I solved it by waiting 7 seconds for the tophat.addToPanel() method only when the extension position is on the "RIGHT" side. So, this shouldn't be solved this way because If I have more GNOME shell extensions, the hard-coded 7 seconds will not be valid. This approach is not precise and might lead to issues if the timeout is too short.

tophat.addToPanel() method to wait dynamically until the signal determines when all extensions are loaded.

To analyze if anyone has experience with gnome-shell development. How can we solve the issue dynamically?

Everyone's guidance and feedback are highly valued.

Thanks!