我靠,大BUG

This commit is contained in:
snltty
2024-04-06 14:39:41 +08:00
parent 7fa3f5fc04
commit f8d072aafb
5 changed files with 42 additions and 13 deletions

View File

@@ -1,2 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Update="MainForm.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>

View File

@@ -20,7 +20,7 @@ namespace cmonitor.wallpaper.win
string imgUrl = "./bg.jpg";
string shareMkey = "cmonitor/share";
int shareMLength = 10;
int shareMLength = 100;
int shareItemMLength = 1024;
int shareKeyBoardIndex = 1;
int shareWallpaperIndex = 2;

View File

@@ -34,14 +34,9 @@ namespace cmonitor.plugins.llock.report
public object GetReports(ReportType reportType)
{
if (reportType == ReportType.Full || shareMemory.ReadVersionUpdated((int)ShareMemoryIndexs.LLock))
report.LockScreen = Running();
if (reportType == ReportType.Full || report.Updated() || shareMemory.ReadVersionUpdated((int)ShareMemoryIndexs.LLock))
{
bool old = lLockConfigInfo.Open;
lLockConfigInfo.Open = report.LockScreen = Running();
if (lLockConfigInfo.Open != old)
{
clientConfig.Set(lLockConfigInfo);
}
return report;
}
return null;
@@ -96,9 +91,14 @@ namespace cmonitor.plugins.llock.report
public bool Open { get; set; }
}
public sealed class LLockReportInfo
public sealed class LLockReportInfo : ReportInfo
{
public bool LockScreen { get; set; }
public override int HashCode()
{
return LockScreen.GetHashCode();
}
}
}

View File

@@ -2,6 +2,7 @@
using cmonitor.config;
using cmonitor.libs;
using common.libs;
using Microsoft.Win32;
namespace cmonitor.plugins.share.report
{
@@ -20,11 +21,34 @@ namespace cmonitor.plugins.share.report
if (config.Common.BlueProtect && OperatingSystem.IsWindows())
{
ProcessBlueProtection.Protect();
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
}
#endif
this.shareMemory = shareMemory;
InitShare();
}
private void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e)
{
if (OperatingSystem.IsWindows())
{
if (e.Reason == SessionSwitchReason.SessionLogoff)
{
ProcessBlueProtection.Unprotect();
}
}
}
private void SystemEvents_SessionEnding(object sender, SessionEndingEventArgs e)
{
if (OperatingSystem.IsWindows())
{
ProcessBlueProtection.Unprotect();
}
}
public object GetReports(ReportType reportType)
{
bool updated = GetShare();

View File

@@ -33,10 +33,9 @@ namespace cmonitor.plugins.wallpaper.report
public object GetReports(ReportType reportType)
{
if (reportType == ReportType.Full || shareMemory.ReadVersionUpdated((int)ShareMemoryIndexs.Wallpaper))
report.Value = Running();
if (reportType == ReportType.Full || report.Updated() || shareMemory.ReadVersionUpdated((int)ShareMemoryIndexs.Wallpaper))
{
report.Value = Running();
return report;
}
return null;