leandrosa81 / taskbar-monitor

monitoring tool with graphs (CPU, memory, disk and network) for Windows taskbar.
https://lugarinho.tech/tools/taskbar-monitor
GNU General Public License v3.0
305 stars 24 forks source link

After version 0.3.2, it does not work properly. #12

Open dasu88 opened 3 years ago

dasu88 commented 3 years ago

I don't know why? After version 0.3.2, I can't run it properly anymore. First of all, the data is not available, and the settings page is fragmented, and the whole system is not working properly, but after returning to 0.3.1, it works fine. 001

leandrosa81 commented 3 years ago

Sorry to hear you are having trouble with the deskband. It seems the control is just not refreshing itself. I will try to reproduce this problem here,. Do you mind telling your windows version, please?

dasu88 commented 3 years ago

Here is my version: Windows 10 Pro 20H2 19042.844

The problem is not only the screen refresh part, but also the chart data is not read correctly (As you can see in the above screenshot, all three parts of the CPU DISK NET are showing 0), and cause Windows operation stalls.

I'm sorry, I'm using online translation to convert to English, I hope you understand what I mean.

leandrosa81 commented 3 years ago

It is very strange. Unfortunately, I am not able to reproduce this behavior on my machine.

It would help a lot if you could test if performance counters are working when this behaviour occurs (example: https://www.windowscentral.com/how-use-performance-monitor-windows-10).

You could also run it in visual studio, and see what is happening on the SystemWatchControl.UpdateGraphs() method (and if it is being called at all):

foreach (var ct in Counters)
{
    ct.Update();
}
dasu88 commented 3 years ago

I tried the performance counter and it works fine. As for visual studio, I can't test it because I don't have the ability to do it. It seems that there is a problem with the taskbar refresh. 0.3.1 is working fine, but later versions are not working correctly. In addition, after the first installation, there will be a short period of normal operation, but after restarting the machine, the exception will appear and can not be used. 001

leandrosa81 commented 3 years ago

So, I did some changes and released a new version (v0.3.4). Could you test it and see if it solves your problem?

Also, you talked about an exception, is there any error message? If yes, could you post here, please?

dasu88 commented 3 years ago

Installed version 0.3.4 to test, the good news is that the data has been displayed properly, but the bad news is that there are still some abnormalities in the implementation. Including the toolbar icon does not appear properly, and will leave a residual image after closing the application, several times restart explorer.exe to test, there is an error, the system provides information as follows.

如需叫用 Just-In-Time (JIT) 偵錯的詳細資料, 請參閱本訊息結尾處 (而非這個對話方塊) 的資訊。

** 例外狀況文字 ** System.InvalidOperationException: 集合已修改; 列舉作業可能尚未執行。 於 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) 於 System.Collections.Generic.List`1.Enumerator.MoveNextRare() 於 TaskbarMonitor.SystemWatcherControl.drawGraph(Graphics formGraphics, Int32 x, Int32 y, Int32 maxH, Boolean invertido, CounterInfo info, GraphTheme theme, CounterOptions opt) 於 TaskbarMonitor.SystemWatcherControl.SystemWatcherControl_Paint(Object sender, PaintEventArgs e) 於 System.Windows.Forms.Control.OnPaint(PaintEventArgs e) 於 System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) 於 System.Windows.Forms.Control.WmPaint(Message& m) 於 System.Windows.Forms.Control.WndProc(Message& m) 於 System.Windows.Forms.UserControl.WndProc(Message& m) 於 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** 已載入的組件 ** mscorlib 組件版本: 4.0.0.0 Win32 版本: 4.8.4341.0 built by: NET48REL1LAST_C 程式碼庫: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

TaskbarMonitor 組件版本: 1.0.0.0 Win32 版本: 1.0.0.0 程式碼庫: file:///C:/Program%20Files%20(x86)/TaskbarMonitor/TaskbarMonitor.DLL

System.Drawing 組件版本: 4.0.0.0 Win32 版本: 4.8.4084.0 built by: NET48REL1 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System 組件版本: 4.0.0.0 Win32 版本: 4.8.4300.0 built by: NET48REL1LAST_C 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms 組件版本: 4.0.0.0 Win32 版本: 4.8.4341.0 built by: NET48REL1LAST_C 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

Newtonsoft.Json 組件版本: 12.0.0.0 Win32 版本: 12.0.3.23909 程式碼庫: file:///C:/Program%20Files%20(x86)/TaskbarMonitor/Newtonsoft.Json.DLL

System.Core 組件版本: 4.0.0.0 Win32 版本: 4.8.4341.0 built by: NET48REL1LAST_C 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Numerics 組件版本: 4.0.0.0 Win32 版本: 4.8.4084.0 built by: NET48REL1 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

System.Runtime.Serialization 組件版本: 4.0.0.0 Win32 版本: 4.8.4250.0 built by: NET48REL1LAST_C 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll

System.Data 組件版本: 4.0.0.0 Win32 版本: 4.8.4270.0 built by: NET48REL1LAST_C 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

System.Xml 組件版本: 4.0.0.0 Win32 版本: 4.8.4084.0 built by: NET48REL1 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

System.Configuration 組件版本: 4.0.0.0 Win32 版本: 4.8.4190.0 built by: NET48REL1LAST_B 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

mscorlib.resources 組件版本: 4.0.0.0 Win32 版本: 4.8.4084.0 built by: NET48REL1 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hant_b77a5c561934e089/mscorlib.resources.dll

System.Windows.Forms.resources 組件版本: 4.0.0.0 Win32 版本: 4.8.4084.0 built by: NET48REL1 程式碼庫: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hant_b77a5c561934e089/System.Windows.Forms.resources.dll

** JIT 偵錯 ** 若要啟用 Just-In-Time (JIT) 偵錯功能,則必須在 此應用程式或電腦的 .config 檔案中,設定 system.windows.forms 區段內的 jitDebugging 值。 且該應用程式也必須在啟用偵錯的狀態下進行 編譯。

例如:

當 JIT 偵錯功能啟用後,會將所有未處理的例外狀況 傳送給電腦上已註冊的 JIT 偵錯工具進行處 理,而不是使用這個對話方塊來處理。

2021-03-18_080054 2021-03-18_075905

KoalaBear84 commented 3 years ago

For the exception part, this is the issue. For the drawing issues I have also no idea what this might be.

The translation of the error is: Collection was modified; enumeration operation may not execute.

So the following line needs to have a .ToList() behind it, or change to another 'list' like implementation.

https://github.com/leandrosa81/taskbar-monitor/blob/d622943e8d0247dc1cd2b0dce83971fd37ea0b05/TaskbarMonitor/SystemWatcherControl.cs#L398

KoalaBear84 commented 3 years ago

There is one thing I'm curious about. What happens when you press Win + Ctrl +Shift + B keys?

https://winaero.com/restart-video-driver-windows-10/

And what when you make a screenshot with PrintScreen ?

And do you have any other 'extensions' like PowerTools?

dasu88 commented 3 years ago

There is one thing I'm curious about. What happens when you press Win + Ctrl +Shift + B keys?

https://winaero.com/restart-video-driver-windows-10/

And what when you make a screenshot with PrintScreen ?

And do you have any other 'extensions' like PowerTools?

I have tried to restart video driver by pressing the shortcut key (press Win + Ctrl +Shift + B keys) while running, but only the screen flickers once without any improvement. Also, I do have Microsoft PowerToys installed, but I have tried to remove it and re-test, same situation. Other than that, I don't think I have any other PowerTools

leandrosa81 commented 3 years ago

Thanks, @KoalaBear84. I wrote some code with locking mechanism, just need some more testing.

leandrosa81 commented 3 years ago

So I just released yesterday version 0.3.5 that should solve this problem. Could you test it, please, @dasu88 ? Thank you and sorry for taking so long top replay since you posted this issue.

dasu88 commented 3 years ago

Thank you for the correction. I have downloaded and installed this version when it was released. In the tools section, it is currently showing normal. However, after installation, the toolbar is still displaying abnormally. From the captures, we can find that the icon on the toolbar is normal before installation, but after installation, the newly opened application on the toolbar cannot display the normal icon, and the toolbar still exists after closing, so I feel there is a problem with the toolbar refresh.

001 002