-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add feature to disable theme switching while certain processes are running #734
Conversation
…nning Adds Panel in SwitchModes Page Adds Module to postpone switching while some processes are running Adds Config to store process block list
Automatically refresh process list on opening dropdown Improve UI of listing for blocked tasks Localize missing strings
Hey, thanks for working on this! I think going for a function first approach similar to how you did it is totally fine for now. If you have any questions about the backend, feel free to reach out.
In the front end it should be fine refreshing every few seconds or so while the UI section is expanded/open.
That is somewhat of a design limit currently because a theme switch request is fired immediately after the application starts, which may or may not be before all modules have finished setting their postpone state. |
Refactor ProcessBlockListModule
I've added a ThemeSwitchApproaching proprty to the globalstate which you can use do determine whether a module is allowed to start running. There's an example in the GPUMonitorModule
Should be a lot more streamlined now and is governor independent. |
In addition, there's also the necessity to register modules that hook into that mechanism via the module's enable hook
And the disable hook
|
Improve related UI for work like GPU Monitoring UI
I believe this feature now works as intended. Or at least it works on my end and doesn't seem to do unnecessary process checks. I think that should be fine since I don't expect there to be a whole lot of postpones in the queue. |
The filtering for the dropdown is still a bit weird, listing processes I wouldn't consider relevant for the feature. I'll look around how other applications handle it but this is a cosmetic issue and does not impact functionality nor usability significantly. |
That is correct. I usually use the monitoring flag because it's easier to read and allows for better logging, but using the postpone queue is also absolutely fine.
Awesome! |
This is a rough fix for #733 currently it can
I'm opening this PR early before I'm done because I'm a bit lost with regards to the following topics.
What's missing as far as I can tell is
Currently it uses a DataGrid, I would love something that looks similar to the Windows' settings
Not sure how to implement that however
What I'm not sure about is the current way to display a list of active processes. I filter for processes with an active handle and a window. This rules out about 100 instances of svchost, but not everything I wouldn't consider an application the user interacts with. For instance ApplicationFrameHost, svchost, and TextInputHost below:
Furthermore I currently require the user to refresh a process list because
maybe there's a better solution I'm not aware of.
Then there's the behavior of the ProcessBlockModule. Running the AutoDarkMode service seems to switch themes immediately, without waiting for the module to be initialized. If I instead start the application and have it wait for a custom time in the near future my Module seems to work fine.
I would appreciate it if someone more experience than me with .NET and WPF could help me out here. Thanks in advance!