Skip to content
This repository was archived by the owner on Sep 18, 2021. It is now read-only.

Commit 2f2ef6f

Browse files
committed
修复xbox闪退的问题
1 parent 069d4eb commit 2f2ef6f

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

BiliBili-UWP/App.xaml.cs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Windows.Foundation;
2020
using Windows.Foundation.Collections;
2121
using Windows.UI.Notifications;
22+
using Windows.UI.ViewManagement;
2223
using Windows.UI.Xaml;
2324
using Windows.UI.Xaml.Controls;
2425
using Windows.UI.Xaml.Controls.Primitives;
@@ -47,12 +48,7 @@ sealed partial class App : Application
4748
public App()
4849
{
4950
this.InitializeComponent();
50-
bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale);
51-
if (SystemInformation.DeviceFamily == "Windows.Xbox" && isDisableScale)
52-
{
53-
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);
54-
Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true);
55-
}
51+
5652
CustomXamlResourceLoader.Current = new CustomResourceLoader();
5753
this.Suspending += OnSuspending;
5854
UnhandledException += OnUnhandleException;
@@ -147,9 +143,9 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e)
147143
if (rootFrame.Content == null)
148144
{
149145
if (_isTabletMode)
150-
rootFrame.Navigate(typeof(TabletMainPage),null);
146+
rootFrame.Navigate(typeof(TabletMainPage), null);
151147
else
152-
rootFrame.Navigate(typeof(DesktopMainPage),null);
148+
rootFrame.Navigate(typeof(DesktopMainPage), null);
153149
}
154150
}
155151
else if (e is ToastNotificationActivatedEventArgs toastActivationArgs)
@@ -183,6 +179,14 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e)
183179
}
184180
Window.Current.Activate();
185181
UIHelper.SetTitleBarColor();
182+
bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale);
183+
if (SystemInformation.DeviceFamily == "Windows.Xbox")
184+
{
185+
var view = ApplicationView.GetForCurrentView();
186+
view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
187+
if (isDisableScale)
188+
ApplicationViewScaling.TrySetDisableLayoutScaling(true);
189+
}
186190
}
187191
catch (Exception ex)
188192
{

BiliBili-UWP/BiliBili-UWP.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
2222
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
2323
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
24-
<AppxPackageDir>E:\Package\BiliBili\</AppxPackageDir>
24+
<AppxPackageDir>D:\Package\BiliBili\</AppxPackageDir>
2525
<GenerateTestArtifacts>False</GenerateTestArtifacts>
2626
<AppxBundle>Always</AppxBundle>
2727
<AppxBundlePlatforms>x86|x64|arm|arm64</AppxBundlePlatforms>

BiliBili-UWP/Others/Update.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
更新说明:
66

7-
1. 添加了优先HEVC的设置项,修复此前部分新电影无法播放音频的问题
8-
2. 调整新动态通知的弹出顺序
7+
1. 修复了在XBOX上无法打开的问题
98

109
祝使用愉快,
1110

BiliBili-UWP/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Identity
1212
Name="60520B029E250.4264454043325"
1313
Publisher="CN=9EFA2047-A580-400B-A5B2-0C7ABB0DB5C0"
14-
Version="1.3.10.0" />
14+
Version="1.3.11.0" />
1515

1616
<mp:PhoneIdentity PhoneProductId="f3e42c1a-303e-47c7-8e3d-d37473c0ec73" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
1717

0 commit comments

Comments
 (0)