weisJ / auto-dark-mode

IDEA plugin to automatically apply system theme settings on macOS and Windows.
https://plugins.jetbrains.com/plugin/14076-auto-dark-mode
MIT License
53 stars 14 forks source link

Reduce polling of AppleInterfaceStyle to a lower frequency #7

Closed Kovah closed 4 years ago

Kovah commented 4 years ago

As Brice Dutheil already pointed out in the Youtrack issue, the plugin currently polls macOS for the current interface style every 3 seconds.

I would like to ask if it's technically possible to reduce this poll to like 30 or 60 seconds to reduce the load a bit? Not sure if it's really needed to check this every 3 seconds.

weisJ commented 4 years ago

I think you are confusing this with another project. In Dark Mode Sync the interface style is polled every 3 seconds.

What this project is doing is the following: Through JNI a native listener for the interface style property is created which receives events if the theme has changed. So I'm not really doing any polling but rather letting the OS notify me about any changes. This ensures that the plugin doesn't do anything if no OS settings change. Same applies on Windows.

Kovah commented 4 years ago

Oops, sorry for that. Seems I had the wrong repo open.

weisJ commented 4 years ago

Don’t worry :)