-
Notifications
You must be signed in to change notification settings - Fork 582
auto-dark-light@gihaume: v2.0.0 #7939
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
base: master
Are you sure you want to change the base?
auto-dark-light@gihaume: v2.0.0 #7939
Conversation
- Closes linuxmint#6758 - Closes linuxmint#7247 - Closes linuxmint#7923
3d0c3b7 to
d15e3c5
Compare
|
@rcalixte What do you mean by marking the PR as draft? |
User-facing code should be readable. The benefits for minification in JavaScript are related to download times not execution times. As the Spices are distributed as compressed files, this isn't a necessary or gainful modification, reproducible or not. Hopefully this makes sense. |
|
I wasn't talking about runtime performance but loading time, but anyway it was like 50 ms versus 100 ms, so no problem. |
|
Hi, I'm going to close this, at least for now. I don't want to let this applet get any more out of hand and bloated than it already is. Looking at the current version there's already a lot of functionality overlap and reinventing the wheel. More effort needs to be made to utilize existing API and patterns common to spices and Cinnamon.
Keep in mind that Cinnamon is a single-threaded application - spices all run in this same thread, and can cause side effects/bugs during normal operations if they're ill-behaved. |
Why closing? We could continue to work on this PR, getting the discussion and requested changes stay in one place.
I'm fully in for utilizing existing API, but I'd need help for pointing what. I tried to do it as much as I could, then finding other ways for what I could not find.
"a periodic timeout to check things" is exactly the opposite of the philosophy of this applet in order to be not based on any periodic polling at all. It only reacts when anything relevant for it has changed. I think that active polling should be reserved to low/mid level services and not apps and that the latter should subscribe listeners to those centralized lower level pollers. I used to use QRedShift and could note the terrible impact of naive active polling on fluidity. One day seeing a movie on VLC I noticed that every n seconds, there was a stutter. I was thinking "WTF is wrong with this OS" after finally realizing that it was QRedShift's fault doing an update of all its values. We've been lucky I have not stopped at the WTF and told the world that Linux Mint Cinnamon is natively bloated. This is exactly what you want to avoid and I worked hard on this applet to make it fully reaction based so the user only pays when and for what it is relevant to do so. Do you understand what the "time change listener" does? It doesn't react each second or minute when the clock naturally updates, but only when the user or the NTP service modifies it. If there's an existing service to subscribe to it, I would use it, but I haven't found any. Regarding the timezone change listener, I also don't get why it would be wrong.
I will have a look on this and come back.
I don't get the point. I worked so thoughtfully doing a fully reaction based applet that does a very low impact on the performance of Cinnamon, as explained above and more. And I think I've succeed to do so.
Now this new version doesn't add anything more connected to Cinnamon than the previous one. The change is mainly the add of MobX to get a reactive paradigm helping the UI state management to be declarative, light, fine-grained, robust and extendable. And it works so well that it has been a key point in my ability to add the features the users asked me to. I’d appreciate your feedback on these points, since I feel my perspective may currently be misunderstood. |
|
I don't know what QRedshift was doing to cause such an impact, but if it was doing that it was simply very poorly written. You could WTF as much as you want, that's not a native applet. This is one of the drawbacks of supporting third-party applets. We try to watch for bad practices and traps but it's not easy to catch, especially when it happens gradually. I realize our documentation isn't as great as it could be - unfortunately the best documentation is looking at Cinnamon's core ui code, and its applets and desklets. We try to make getting at system services and states pretty easy, and if it makes sense, we'll make it so it's available for spices to use (like the screensaver or session state). Questions like 'How can I...' brought up in Github discussions I'll usually try to answer also. I did look at the time change listener, I realize it only triggers for that specific event. I think this is too far to go for efficiency. An extra process running on the remote (or at least, fairly uncommon) chance that the time gets updated. 99% of the time if this triggers, it will be because your timezone changed (which you're also listening separately for). Very likely the timezone monitor is enough. Doing something as simple as comparing times every 30 minutes (or even every 5) will not negatively impact your desktop. |
|
OK, thanks. I will work on these. |
Note that I used JS minification so the applet loads faster. I understand it looks like compiled binary (that you avoid) but unlike the latter it should be fully reproducible on any system. I added an automatic checksum so anyone can verify the integrity easily.