🚑 修复可能导致输入法特定场景卡顿的问题

This commit is contained in:
BookerLiu
2022-08-30 09:06:27 +08:00
parent cbaeb71a0c
commit e82af431b5
31 changed files with 2687 additions and 430 deletions

View File

@@ -47,7 +47,7 @@ namespace GeekDesk.Control.UserControls.Config
if (!CheckIsEnable(hkType)) return;
if (prevKeyTemp == Key.None || prevKeyTemp != downKey)
{
if (hotkeyFinished)
@@ -315,14 +315,17 @@ namespace GeekDesk.Control.UserControls.Config
/// <param name="e"></param>
private void MouseMiddle_Changed(object sender, RoutedEventArgs e)
{
if (appConfig.MouseMiddleShow)
{
MouseHookThread.MiddleHook();
}
else
{
MouseHookThread.Dispose();
}
//if (appConfig.MouseMiddleShow)
//{
// MouseHookThread.MiddleHook();
//}
//else
//{
// MouseHookThread.DisposeMiddle();
//}
MouseHookThread.Dispose();
MouseHookThread.Hook();
}
/// <summary>
@@ -339,7 +342,8 @@ namespace GeekDesk.Control.UserControls.Config
if (true == appConfig.EnableAppHotKey)
{
MainWindow.RegisterHotKey(false);
} else
}
else
{
if (MainWindow.hotKeyId != -1)
{

View File

@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppConfig}"
mc:Ignorable="d"
Background="Transparent"
d:DesignHeight="400" d:DesignWidth="500"
@@ -41,6 +41,20 @@
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<TextBlock Text="插件" Margin="0,20,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,6,0,0">
<CheckBox Content="时钟显秒" Click="ShowSeconds_Click" IsChecked="{Binding SecondsWindow}"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="仅Win11有效"
hc:Poptip.Placement="TopLeft">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<TextBlock Text="排序方式" Margin="0,25,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
@@ -93,7 +107,7 @@
Foreground="Black"
IsChecked="{Binding UpdateType, Mode=TwoWay, Converter={StaticResource UpdateTypeConvert}, ConverterParameter=2}"/>
</hc:UniformSpacingPanel>
<TextBlock Text="其它" Margin="0,25,0,0"/>
<hc:UniformSpacingPanel Spacing="10" Margin="20,8,0,0">
<Button Content="备份数据"

View File

@@ -1,6 +1,12 @@
using GeekDesk.Constant;
using GeekDesk.MyThread;
using GeekDesk.Util;
using GeekDesk.ViewModel;
//using ShowSeconds;
using System;
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
@@ -112,5 +118,80 @@ namespace GeekDesk.Control.UserControls.Config
{
CommonCode.BakAppData();
}
private void ShowSeconds_Click(object sender, RoutedEventArgs e)
{
//if (MainWindow.appData.AppConfig.SecondsWindow == true)
//{
// //StartSecondsWindow();
// //SecondsWindow.ShowWindow();
// MouseHookThread.Dispose();
// MouseHookThread.Hook();
//}
//else
//{
// MouseHookThread.Dispose();
// MouseHookThread.Hook();
//}
MouseHookThread.Dispose();
MouseHookThread.Hook();
}
public static void StopSecondsWindow()
{
if (MessageUtil.CheckWindowIsRuning("ShowSeconds_Main_" + Constants.MY_UUID))
{
MessageUtil.SendMsgByWName(
"ShowSeconds_Main_" + Constants.MY_UUID,
"Shutdown"
);
}
}
//public static void StartSecondsWindow()
//{
// try
// {
// using (var objOS = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
// {
// foreach (ManagementObject objMgmt in objOS.Get())
// {
// if (objMgmt.Properties["Caption"].Value != null)
// {
// string caption = objMgmt.Properties["Caption"].Value.ToString(); ;
// LogUtil.WriteLog("获取的系统版本号为:" + caption);
// if (caption.Contains("Windows 11"))
// {
// //找到ShowSeconds插件
// FileInfo fi = FileUtil.GetFileByNameWithDir("ShowSeconds.exe", Constants.PLUGINS_PATH);
// if (fi == null)
// {
// HandyControl.Controls.MessageBox.Show("未安装程序插件:ShowSeconds");
// }
// else
// {
// //检查是否在运行
// if (!MessageUtil.CheckWindowIsRuning("ShowSeconds_Main_" + Constants.MY_UUID))
// {
// using (Process p = new Process())
// {
// p.StartInfo.FileName = fi.FullName;
// p.StartInfo.WorkingDirectory = fi.FullName.Substring(0, fi.FullName.LastIndexOf("\\"));
// p.Start();
// }
// }
// }
// }
// }
// }
// }
// }
// catch (Exception ex) { }
//}
}
}