nefares / Background-Muter

Background Muter - Automatically Mute Background Applications
GNU General Public License v3.0
83 stars 8 forks source link

There are two problems that are inconvenient to use. #8

Closed Lioreas closed 3 weeks ago

Lioreas commented 2 years ago

The first is that when i turn on Enable autostart, the volume is turned off for programs that i didn't leave as mute exception before double-clicking on the tray.(Working after double-clicking on the tray)

Second, after changing the program, the "Setting changed" window appears every time i turn off the program even though i press Save changes. (If there is no change, it does not appear.) This causes problems that i have to press the shutdown button each time you turn off the computer, ignore the program's warning, or press the Cancel button, press yes for this program, and then turn it off again.

nefares commented 2 years ago

Thanks for the report.

Regarding the second point I have provided a fix in the latest release 1.0.5: https://github.com/nefares/Background-Muter/releases/tag/v1.0.5

Regarding the first point: I'm not able to replicate this. Could you give me the steps to re-create the issue? Enabling autostart should have no effect on the Mute/Unmute functionality.

Lioreas commented 2 years ago

I guess the syntax of Background Muter.lnk in the startup program -- startMinimized works differently for each computer. In my case, programs that are not handled as exceptions in the GUI will remain muted until I run the GUI in the tray.

I guess --startMinimized is making the execution weird.

lamrongol commented 4 weeks ago

I guess --startMinimized is making the execution weird.

I think so, too. I found BG Muter doesn't work when booted by "Autostart", which has --startMinimized option. It starts to work when clicking the tray icon and the form is displayed.

I confirmed RunMuter() is not fired when booted with --startMinimized option and RunMuter() is executed by MuterCallback() which is excecuted by MuterTimer_Tick, and the following post says tick is affected when the form is minimized: https://stackoverflow.com/q/2166773/3809427

However, once the form is displayed, even if it retuns to tray icon, it works continually. I can't understand this phenomenon any more.

lamrongol commented 3 weeks ago

I found a released binary file's form title is image

However, I pulled the newest source code(I confirmed that it is not different from released source code) and compiled and run, Title of the form is: image

This difference originate from WinBGMuter.dll which is l.509~516 of MainForm.cs. I don't know what it mean but this may cause the problem in different environments.

nefares commented 3 weeks ago

@Lioreas This is definitly a bug. The original code prevents the MainForm_Load from executing, causing the muter to never actually initialize. @lamrongol I have merged your code into the master branch with some small changes (the minimizing code is now under the Shown event of the MainForm

Lastest release is under: https://github.com/nefares/Background-Muter/releases/tag/v1.0.10

nefares commented 3 weeks ago

I found a released binary file's form title is image

However, I pulled the newest source code(I confirmed that it is not different from released source code) and compiled and run, Title of the form is: image

This difference originate from WinBGMuter.dll which is l.509~516 of MainForm.cs. I don't know what it mean but this may cause the problem in different environments.

This behavior is caused by the build process. When building locally, the app will include a genetic version with the latest commit. When building using Github Actions CI/CD, it will automatically take the latest release number and show it in Background muter. Feel free to read the github actions file here: https://github.com/nefares/Background-Muter/blob/master/.github/workflows/tagged-release.yml