diff --git a/BetterGenshinImpact/Core/Config/MaskWindowConfig.cs b/BetterGenshinImpact/Core/Config/MaskWindowConfig.cs
index 98cfccd1..49143e8b 100644
--- a/BetterGenshinImpact/Core/Config/MaskWindowConfig.cs
+++ b/BetterGenshinImpact/Core/Config/MaskWindowConfig.cs
@@ -63,13 +63,6 @@ public partial class MaskWindowConfig : ObservableObject
[ObservableProperty]
private bool _showFps = false;
- ///
- /// 作为原神子窗体
- /// 有些bug没解决
- ///
- [ObservableProperty]
- private bool _useSubform = false;
-
///
/// 遮罩文本透明度 (0.0-1.0)
///
diff --git a/BetterGenshinImpact/GameTask/TaskTriggerDispatcher.cs b/BetterGenshinImpact/GameTask/TaskTriggerDispatcher.cs
index f274c93a..41e7e5f8 100644
--- a/BetterGenshinImpact/GameTask/TaskTriggerDispatcher.cs
+++ b/BetterGenshinImpact/GameTask/TaskTriggerDispatcher.cs
@@ -1,4 +1,4 @@
-using BetterGenshinImpact.Core.Config;
+using BetterGenshinImpact.Core.Config;
using BetterGenshinImpact.GameTask.Common;
using BetterGenshinImpact.Helpers;
using BetterGenshinImpact.View;
@@ -259,14 +259,11 @@ namespace BetterGenshinImpact.GameTask
Debug.WriteLine("游戏窗口不在前台, 不再进行截屏");
}
- if (!TaskContext.Instance().Config.MaskWindowConfig.UseSubform)
+ var pName = SystemControl.GetActiveProcessName();
+ if (pName != "Idle" && pName != "BetterGI" && pName != "YuanShen" && pName != "GenshinImpact" && pName != "Genshin Impact Cloud Game")
{
- var pName = SystemControl.GetActiveProcessName();
- if (pName != "Idle" && pName != "BetterGI" && pName != "YuanShen" && pName != "GenshinImpact" && pName != "Genshin Impact Cloud Game")
- {
- // Debug.WriteLine(pName + ":hide mask window");
- maskWindow.Invoke(() => { maskWindow.HideSelf(); });
- }
+ // Debug.WriteLine(pName + ":hide mask window");
+ maskWindow.Invoke(() => { maskWindow.HideSelf(); });
}
_prevGameActive = active;
@@ -302,23 +299,20 @@ namespace BetterGenshinImpact.GameTask
else
{
PictureInPictureService.Hide(resetManual: true);
- if (!TaskContext.Instance().Config.MaskWindowConfig.UseSubform)
+ // if (!_prevGameActive)
+ // {
+ maskWindow.Invoke(() =>
{
- // if (!_prevGameActive)
- // {
- maskWindow.Invoke(() =>
+ if (maskWindow.IsExist())
{
- if (maskWindow.IsExist())
+ maskWindow.Show();
+ if (!_prevGameActive)
{
- maskWindow.Show();
- if (!_prevGameActive)
- {
- maskWindow.BringToTop();
- }
+ maskWindow.BringToTop();
}
- });
- // }
- }
+ }
+ });
+ // }
_prevGameActive = active;
// // 移动游戏窗口的时候同步遮罩窗口的位置,此时不进行捕获
@@ -528,4 +522,4 @@ namespace BetterGenshinImpact.GameTask
}
}
}
-}
\ No newline at end of file
+}
diff --git a/BetterGenshinImpact/View/MaskWindow.xaml.cs b/BetterGenshinImpact/View/MaskWindow.xaml.cs
index ba5d0e9b..26d3c830 100644
--- a/BetterGenshinImpact/View/MaskWindow.xaml.cs
+++ b/BetterGenshinImpact/View/MaskWindow.xaml.cs
@@ -43,7 +43,6 @@ public partial class MaskWindow : Window
private static readonly Typeface _typeface;
private static readonly Typeface _fgiTypeface;
- private nint _hWnd;
private MaskWindowViewModel? _viewModel;
private IRichTextBox? _richTextBox;
@@ -104,14 +103,7 @@ public partial class MaskWindow : Window
public void RefreshPosition()
{
- if (TaskContext.Instance().Config.MaskWindowConfig.UseSubform)
- {
- RefreshPositionForSubform();
- }
- else
- {
- RefreshPositionForNormal();
- }
+ RefreshPositionForNormal();
}
public void RefreshPositionForNormal()
@@ -130,13 +122,6 @@ public partial class MaskWindow : Window
});
}
- public void RefreshPositionForSubform()
- {
- nint targetHWnd = TaskContext.Instance().GameHandle;
- _ = User32.GetClientRect(targetHWnd, out RECT targetRect);
- _ = User32.SetWindowPos(_hWnd, IntPtr.Zero, 0, 0, targetRect.Width, targetRect.Height, User32.SetWindowPosFlags.SWP_SHOWWINDOW);
- }
-
public MaskWindow()
{
_maskWindow = this;
@@ -204,17 +189,6 @@ public partial class MaskWindow : Window
UpdateClickThroughState();
- if (TaskContext.Instance().Config.MaskWindowConfig.UseSubform)
- {
- _hWnd = new WindowInteropHelper(this).Handle;
- nint targetHWnd = TaskContext.Instance().GameHandle;
-
- if (User32.GetParent(_hWnd) != targetHWnd)
- {
- _ = User32.SetParent(_hWnd, targetHWnd);
- }
- }
-
RefreshPosition();
PrintSystemInfo();
if (_viewModel != null)
diff --git a/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml b/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml
index 578bb8a4..1f223a77 100644
--- a/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml
+++ b/BetterGenshinImpact/View/Pages/CommonSettingsPage.xaml
@@ -449,33 +449,6 @@
FontSize="14"
Text="{Binding Config.MaskWindowConfig.TextOpacity, StringFormat=F2}" />
-
-
-