mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
fix: 修复 Win11 24H2 中 Graphics Capture 帧率异常
This commit is contained in:
parent
f24e46e368
commit
0c26c596fd
32 changed files with 133 additions and 42 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{62503530-b84b-4cc2-80b6-3f89618172b7}</ProjectGuid>
|
||||
<RootNamespace>Effects</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\obj\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ namespace Magpie.App {
|
|||
#include "ScalingModesPage.idl"
|
||||
#include "ProfilePage.idl"
|
||||
#include "SettingsPage.idl"
|
||||
#include "BlueInfoBarStyle.idl"
|
||||
|
||||
namespace Magpie.App {
|
||||
enum ShortcutAction {
|
||||
|
|
|
|||
5
src/Magpie.App/BlueInfoBarStyle.cpp
Normal file
5
src/Magpie.App/BlueInfoBarStyle.cpp
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#include "pch.h"
|
||||
#include "BlueInfoBarStyle.h"
|
||||
#if __has_include("BlueInfoBarStyle.g.cpp")
|
||||
#include "BlueInfoBarStyle.g.cpp"
|
||||
#endif
|
||||
10
src/Magpie.App/BlueInfoBarStyle.h
Normal file
10
src/Magpie.App/BlueInfoBarStyle.h
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#pragma once
|
||||
#include "BlueInfoBarStyle.g.h"
|
||||
|
||||
namespace winrt::Magpie::App::implementation {
|
||||
struct BlueInfoBarStyle : BlueInfoBarStyleT<BlueInfoBarStyle> {};
|
||||
}
|
||||
|
||||
namespace winrt::Magpie::App::factory_implementation {
|
||||
struct BlueInfoBarStyle : BlueInfoBarStyleT<BlueInfoBarStyle, implementation::BlueInfoBarStyle> {};
|
||||
}
|
||||
6
src/Magpie.App/BlueInfoBarStyle.idl
Normal file
6
src/Magpie.App/BlueInfoBarStyle.idl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
namespace Magpie.App {
|
||||
[default_interface]
|
||||
runtimeclass BlueInfoBarStyle : Windows.UI.Xaml.ResourceDictionary {
|
||||
BlueInfoBarStyle();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
<!-- 显示信息的 InfoBar 背景改为蓝色 -->
|
||||
<!-- 来自 https://github.com/microsoft/PowerToys/blob/3fe78fed65f4a5dc1d309911b8acbe729a0b9f52/src/settings-ui/Settings.UI/SettingsXAML/Themes/Colors.xaml -->
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<!-- 26100 SDK 存在 bug,导致所有 XAML 文件都必须指定 x:Class,一旦修复应还原更改 -->
|
||||
<ResourceDictionary x:Class="Magpie.App.BlueInfoBarStyle"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
IsOpen="{x:Bind ViewModel.IsShowTouchSupportInfoBar, Mode=OneWay}"
|
||||
Severity="Informational">
|
||||
<muxc:InfoBar.Resources>
|
||||
<ResourceDictionary Source="ms-appx:///Magpie.App/BlueInfoBar.xaml" />
|
||||
<ResourceDictionary Source="ms-appx:///Magpie.App/BlueInfoBarStyle.xaml" />
|
||||
</muxc:InfoBar.Resources>
|
||||
</muxc:InfoBar>
|
||||
</local:SettingsGroup>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<!-- 移植自 https://github.com/microsoft/PowerToys/blob/35bfb0f83e5fc08cc04398e7aa98d77774412d3f/src/settings-ui/Settings.UI/Controls/KeyVisual/KeyVisual.xaml -->
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<!-- 26100 SDK 存在 bug,导致所有 XAML 文件都必须指定 x:Class,一旦修复应还原更改 -->
|
||||
<ResourceDictionary x:Class="Magpie.App.KeyVisualStyle"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Magpie.App">
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
#if __has_include("KeyVisual.g.cpp")
|
||||
#include "KeyVisual.g.cpp"
|
||||
#endif
|
||||
#if __has_include("KeyVisualStyle.g.cpp")
|
||||
#include "KeyVisualStyle.g.cpp"
|
||||
#endif
|
||||
#include "StrUtils.h"
|
||||
#include "Win32Utils.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "KeyVisual.g.h"
|
||||
#include "KeyVisualStyle.g.h"
|
||||
|
||||
namespace winrt::Magpie::App::implementation {
|
||||
|
||||
|
|
@ -65,11 +66,13 @@ private:
|
|||
IsEnabledChanged_revoker _isEnabledChangedRevoker;
|
||||
};
|
||||
|
||||
struct KeyVisualStyle : KeyVisualStyleT<KeyVisualStyle> {};
|
||||
|
||||
}
|
||||
|
||||
namespace winrt::Magpie::App::factory_implementation {
|
||||
|
||||
struct KeyVisual : KeyVisualT<KeyVisual, implementation::KeyVisual> {
|
||||
};
|
||||
struct KeyVisual : KeyVisualT<KeyVisual, implementation::KeyVisual> {};
|
||||
struct KeyVisualStyle : KeyVisualStyleT<KeyVisualStyle, implementation::KeyVisualStyle> {};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,4 +20,9 @@ namespace Magpie.App {
|
|||
static Windows.UI.Xaml.DependencyProperty VisualTypeProperty { get; };
|
||||
static Windows.UI.Xaml.DependencyProperty IsErrorProperty { get; };
|
||||
}
|
||||
|
||||
[default_interface]
|
||||
runtimeclass KeyVisualStyle : Windows.UI.Xaml.ResourceDictionary {
|
||||
KeyVisualStyle();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.26100.0</WindowsTargetPlatformMinVersion>
|
||||
<ProjectPriIndexName>Magpie.App</ProjectPriIndexName>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<AppxBundlePlatforms>x64|arm64</AppxBundlePlatforms>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsDesktop, Version=10.0.22621.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsDesktop.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsDesktop, Version=10.0.22621.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsDesktop.props')" />
|
||||
<Import Project="$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsDesktop, Version=10.0.26100.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsDesktop.props" Condition="exists('$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformExtensionSDKLocation(`WindowsDesktop, Version=10.0.26100.0`, $(TargetPlatformIdentifier), $(TargetPlatformVersion), $(SDKReferenceDirectoryRoot), $(SDKExtensionDirectoryRoot), $(SDKReferenceRegistryRoot)))\DesignTime\CommonConfiguration\Neutral\WindowsDesktop.props')" />
|
||||
<Import Project="..\Common.Post.props" />
|
||||
<Import Project="..\WinUI.targets" />
|
||||
<Import Project="$(SolutionDir)\.conan\$(MSBuildProjectName)\conandeps.props" Condition="Exists('$(SolutionDir)\.conan\$(MSBuildProjectName)\conandeps.props')" />
|
||||
|
|
@ -76,6 +76,10 @@
|
|||
<ClInclude Include="AppSettings.h" />
|
||||
<ClInclude Include="AppXReader.h" />
|
||||
<ClInclude Include="AutoStartHelper.h" />
|
||||
<ClInclude Include="BlueInfoBarStyle.h">
|
||||
<DependentUpon>BlueInfoBarStyle.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BoolNegationConverter.h">
|
||||
<DependentUpon>BoolNegationConverter.idl</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
|
|
@ -252,6 +256,10 @@
|
|||
<ClCompile Include="AppSettings.cpp" />
|
||||
<ClCompile Include="AppXReader.cpp" />
|
||||
<ClCompile Include="AutoStartHelper.cpp" />
|
||||
<ClCompile Include="BlueInfoBarStyle.cpp">
|
||||
<DependentUpon>BlueInfoBarStyle.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BoolNegationConverter.cpp">
|
||||
<DependentUpon>BoolNegationConverter.idl</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
|
|
@ -411,6 +419,10 @@
|
|||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="BlueInfoBarStyle.idl">
|
||||
<DependentUpon>BlueInfoBarStyle.xaml</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="SettingsExpanderCornerRadiusConverter.idl">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
|
|
@ -542,7 +554,7 @@
|
|||
<Page Include="AboutPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="BlueInfoBar.xaml">
|
||||
<Page Include="BlueInfoBarStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="CaptionButtonsControl.xaml">
|
||||
|
|
@ -596,7 +608,7 @@
|
|||
<ResourceCompile Include="Magpie.App.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SDKReference Include="WindowsDesktop, Version=10.0.22621.0" />
|
||||
<SDKReference Include="WindowsDesktop, Version=10.0.26100.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PRIResource Include="Resources.language-de.resw" />
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@
|
|||
<Page Include="ScalingModesPage.xaml">
|
||||
<Filter>Pages</Filter>
|
||||
</Page>
|
||||
<Page Include="BlueInfoBar.xaml">
|
||||
<Page Include="BlueInfoBarStyle.xaml">
|
||||
<Filter>Styles</Filter>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<!-- 移植自 https://github.com/CommunityToolkit/Windows/blob/efbaf965029806fe29e02a6421af3c8f434e1460/components/SettingsControls/src/SettingsCard/SettingsCard.xaml -->
|
||||
<!-- 移植自 https://github.com/CommunityToolkit/Windows/blob/efbaf965029806fe29e02a6421af3c8f434e1460/components/SettingsControls/src/SettingsCard/SettingsCard.xaml -->
|
||||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<!-- 26100 SDK 存在 bug,导致所有 XAML 文件都必须指定 x:Class,一旦修复应还原更改 -->
|
||||
<ResourceDictionary x:Class="Magpie.App.SettingsCardStyle"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Magpie.App"
|
||||
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@
|
|||
#if __has_include("SettingsCard.g.cpp")
|
||||
#include "SettingsCard.g.cpp"
|
||||
#endif
|
||||
#if __has_include("SettingsCardStyle.g.cpp")
|
||||
#include "SettingsCardStyle.g.cpp"
|
||||
#endif
|
||||
#include <winrt/Windows.UI.Input.h>
|
||||
|
||||
using namespace winrt;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "SettingsCard.g.h"
|
||||
#include "SettingsCardStyle.g.h"
|
||||
|
||||
namespace winrt::Magpie::App::implementation {
|
||||
|
||||
|
|
@ -97,11 +98,13 @@ private:
|
|||
bool _isCursorOnControl = false;
|
||||
};
|
||||
|
||||
struct SettingsCardStyle : SettingsCardStyleT<SettingsCardStyle> {};
|
||||
|
||||
}
|
||||
|
||||
namespace winrt::Magpie::App::factory_implementation {
|
||||
|
||||
struct SettingsCard : SettingsCardT<SettingsCard, implementation::SettingsCard> {
|
||||
};
|
||||
struct SettingsCard : SettingsCardT<SettingsCard, implementation::SettingsCard> {};
|
||||
struct SettingsCardStyle : SettingsCardStyleT<SettingsCardStyle, implementation::SettingsCardStyle> {};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,4 +44,9 @@ namespace Magpie.App{
|
|||
Boolean IsActionIconVisible;
|
||||
Boolean IsWrapEnabled;
|
||||
}
|
||||
|
||||
[default_interface]
|
||||
runtimeclass SettingsCardStyle : Windows.UI.Xaml.ResourceDictionary {
|
||||
SettingsCardStyle();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<!-- 移植自 https://github.com/CommunityToolkit/Windows/blob/efbaf965029806fe29e02a6421af3c8f434e1460/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml -->
|
||||
<!-- 移植自 https://github.com/CommunityToolkit/Windows/blob/efbaf965029806fe29e02a6421af3c8f434e1460/components/SettingsControls/src/SettingsExpander/SettingsExpander.xaml -->
|
||||
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<!-- 26100 SDK 存在 bug,导致所有 XAML 文件都必须指定 x:Class,一旦修复应还原更改 -->
|
||||
<ResourceDictionary x:Class="Magpie.App.SettingsExpanderStyle"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:animatedvisuals="using:Microsoft.UI.Xaml.Controls.AnimatedVisuals"
|
||||
xmlns:local="using:Magpie.App"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
// 移植自 https://github.com/CommunityToolkit/Windows/tree/efbaf965029806fe29e02a6421af3c8f434e1460/components/SettingsControls/src/SettingsExpander
|
||||
// 移植自 https://github.com/CommunityToolkit/Windows/tree/efbaf965029806fe29e02a6421af3c8f434e1460/components/SettingsControls/src/SettingsExpander
|
||||
|
||||
#include "pch.h"
|
||||
#include "SettingsExpander.h"
|
||||
#if __has_include("SettingsExpander.g.cpp")
|
||||
#include "SettingsExpander.g.cpp"
|
||||
#endif
|
||||
#if __has_include("SettingsExpanderStyle.g.cpp")
|
||||
#include "SettingsExpanderStyle.g.cpp"
|
||||
#endif
|
||||
|
||||
using namespace winrt;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
#include "SettingsExpander.g.h"
|
||||
#include "SettingsExpanderStyle.g.h"
|
||||
#include "WinRTUtils.h"
|
||||
|
||||
namespace winrt::Magpie::App::implementation {
|
||||
|
|
@ -71,11 +72,13 @@ private:
|
|||
void _OnItemsConnectedPropertyChanged();
|
||||
};
|
||||
|
||||
struct SettingsExpanderStyle : SettingsExpanderStyleT<SettingsExpanderStyle> {};
|
||||
|
||||
}
|
||||
|
||||
namespace winrt::Magpie::App::factory_implementation {
|
||||
|
||||
struct SettingsExpander : SettingsExpanderT<SettingsExpander, implementation::SettingsExpander> {
|
||||
};
|
||||
struct SettingsExpander : SettingsExpanderT<SettingsExpander, implementation::SettingsExpander> {};
|
||||
struct SettingsExpanderStyle : SettingsExpanderStyleT<SettingsExpanderStyle, implementation::SettingsExpanderStyle> {};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,4 +28,9 @@ namespace Magpie.App {
|
|||
event SignalDelegate Expanded;
|
||||
event SignalDelegate Collapsed;
|
||||
}
|
||||
|
||||
[default_interface]
|
||||
runtimeclass SettingsExpanderStyle : Windows.UI.Xaml.ResourceDictionary {
|
||||
SettingsExpanderStyle();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<!-- 移植自 https://github.com/microsoft/PowerToys/blob/bf7462b1965ccbe4e9d90a1b9e79b243798f0cc3/src/settings-ui/Settings.UI/SettingsXAML/Controls/SettingsGroup/SettingsGroup.xaml -->
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<!-- 26100 SDK 存在 bug,导致所有 XAML 文件都必须指定 x:Class,一旦修复应还原更改 -->
|
||||
<ResourceDictionary x:Class="Magpie.App.SettingsGroupStyle"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:Magpie.App">
|
||||
<Style TargetType="local:SettingsGroup">
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
#if __has_include("SettingsGroup.g.cpp")
|
||||
#include "SettingsGroup.g.cpp"
|
||||
#endif
|
||||
#if __has_include("SettingsGroupStyle.g.cpp")
|
||||
#include "SettingsGroupStyle.g.cpp"
|
||||
#endif
|
||||
|
||||
using namespace winrt;
|
||||
using namespace Windows::UI::Xaml::Controls;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include "SettingsGroup.g.h"
|
||||
#include "SettingsGroupStyle.g.h"
|
||||
|
||||
namespace winrt::Magpie::App::implementation {
|
||||
|
||||
|
|
@ -27,11 +28,13 @@ private:
|
|||
IsEnabledChanged_revoker _isEnabledChangedRevoker;
|
||||
};
|
||||
|
||||
struct SettingsGroupStyle : SettingsGroupStyleT<SettingsGroupStyle> {};
|
||||
|
||||
}
|
||||
|
||||
namespace winrt::Magpie::App::factory_implementation {
|
||||
|
||||
struct SettingsGroup : SettingsGroupT<SettingsGroup, implementation::SettingsGroup> {
|
||||
};
|
||||
struct SettingsGroup : SettingsGroupT<SettingsGroup, implementation::SettingsGroup> {};
|
||||
struct SettingsGroupStyle : SettingsGroupStyleT<SettingsGroupStyle, implementation::SettingsGroupStyle> {};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,4 +10,9 @@ namespace Magpie.App {
|
|||
Object Header;
|
||||
Object Description;
|
||||
}
|
||||
|
||||
[default_interface]
|
||||
runtimeclass SettingsGroupStyle : Windows.UI.Xaml.ResourceDictionary {
|
||||
SettingsGroupStyle();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -404,8 +404,7 @@ bool GraphicsCaptureFrameSource::_StartCapture() noexcept {
|
|||
}
|
||||
|
||||
try {
|
||||
// 创建帧缓冲池
|
||||
// 帧的尺寸和 _captureItem.Size() 不同
|
||||
// 创建帧缓冲池。帧的尺寸和 _captureItem.Size() 不同
|
||||
_captureFramePool = winrt::Direct3D11CaptureFramePool::Create(
|
||||
_wrappedD3DDevice,
|
||||
winrt::DirectXPixelFormat::B8G8R8A8UIntNormalized,
|
||||
|
|
@ -413,31 +412,35 @@ bool GraphicsCaptureFrameSource::_StartCapture() noexcept {
|
|||
{ (int)_frameBox.right, (int)_frameBox.bottom } // 帧的尺寸为包含源窗口的最小尺寸
|
||||
);
|
||||
|
||||
// 注册回调是为了确保每当有新的帧时会向当前线程发送消息
|
||||
// 回调中什么也不做
|
||||
// 注册回调是为了确保每当有新的帧时会向当前线程发送消息,回调中什么也不做
|
||||
_captureFramePool.FrameArrived([](const auto&, const auto&) {});
|
||||
|
||||
_captureSession = _captureFramePool.CreateCaptureSession(_captureItem);
|
||||
|
||||
// 不捕获光标
|
||||
// 禁止捕获光标。从 Win10 v2004 开始支持
|
||||
if (winrt::ApiInformation::IsPropertyPresent(
|
||||
winrt::name_of<winrt::GraphicsCaptureSession>(),
|
||||
L"IsCursorCaptureEnabled"
|
||||
)) {
|
||||
// 从 v2004 开始提供
|
||||
)) {
|
||||
_captureSession.IsCursorCaptureEnabled(false);
|
||||
}
|
||||
|
||||
// 不显示黄色边框
|
||||
// 不显示黄色边框,Win32 应用中无需请求权限。从 Win11 开始支持
|
||||
if (winrt::ApiInformation::IsPropertyPresent(
|
||||
winrt::name_of<winrt::GraphicsCaptureSession>(),
|
||||
L"IsBorderRequired"
|
||||
)) {
|
||||
// 从 Win10 v2104 开始提供
|
||||
// Win32 应用中无需请求权限
|
||||
)) {
|
||||
_captureSession.IsBorderRequired(false);
|
||||
}
|
||||
|
||||
// Win11 24H2 中必须设置 MinUpdateInterval 才能使捕获帧率超过 60FPS
|
||||
if (winrt::ApiInformation::IsPropertyPresent(
|
||||
winrt::name_of<winrt::GraphicsCaptureSession>(),
|
||||
L"MinUpdateInterval"
|
||||
)) {
|
||||
_captureSession.MinUpdateInterval(1ms);
|
||||
}
|
||||
|
||||
_captureSession.StartCapture();
|
||||
} catch (const winrt::hresult_error& e) {
|
||||
Logger::Get().Info(StrUtils::Concat("Graphics Capture 失败: ", StrUtils::UTF16ToUTF8(e.message())));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{0e5205ae-dfa9-4cb8-b662-e43cd6512e2a}</ProjectGuid>
|
||||
<RootNamespace>Magpie.Core</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>Magpie.Core</ProjectName>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{1801171b-65b6-400f-92ff-73eaf499cfb3}</ProjectGuid>
|
||||
<RootNamespace>Magpie</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<!-- OutDir 不能放入 Common.Post.props,否则有时会导致编译失败 -->
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<!-- Up-to-date 检查无法检测到 UWP 项目的更改 -->
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<!-- 启用 Segoe UI Variable 和 Segoe Fluent Icons -->
|
||||
<maxversiontested Id="10.0.22000.0"/>
|
||||
<maxversiontested Id="10.0.22621.0"/>
|
||||
<maxversiontested Id="10.0.22631.0"/>
|
||||
<maxversiontested Id="10.0.26100.0"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{05b51bb8-08cb-4907-884f-8e2ad6bf6052}</ProjectGuid>
|
||||
<RootNamespace>TouchHelper</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<!-- 不依赖 Shared 项目 -->
|
||||
<NoShared>true</NoShared>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{e82b7a20-0557-4dc1-b418-87977d7450a4}</ProjectGuid>
|
||||
<RootNamespace>Updater</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<!-- 不依赖 Shared 项目 -->
|
||||
<NoShared>true</NoShared>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{456ccae4-2c51-4cf2-8d3a-1efce8c41a2d}</ProjectGuid>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
|
||||
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)\obj\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
|
||||
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue