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

Commit

Permalink
修复xbox闪退的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy committed Dec 10, 2020
1 parent 069d4eb commit 2f2ef6f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
20 changes: 12 additions & 8 deletions BiliBili-UWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Notifications;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
Expand Down Expand Up @@ -47,12 +48,7 @@ sealed partial class App : Application
public App()
{
this.InitializeComponent();
bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale);
if (SystemInformation.DeviceFamily == "Windows.Xbox" && isDisableScale)
{
Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);
Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true);
}

CustomXamlResourceLoader.Current = new CustomResourceLoader();
this.Suspending += OnSuspending;
UnhandledException += OnUnhandleException;
Expand Down Expand Up @@ -147,9 +143,9 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e)
if (rootFrame.Content == null)
{
if (_isTabletMode)
rootFrame.Navigate(typeof(TabletMainPage),null);
rootFrame.Navigate(typeof(TabletMainPage), null);
else
rootFrame.Navigate(typeof(DesktopMainPage),null);
rootFrame.Navigate(typeof(DesktopMainPage), null);
}
}
else if (e is ToastNotificationActivatedEventArgs toastActivationArgs)
Expand Down Expand Up @@ -183,6 +179,14 @@ private void OnLaunchedOrActivated(IActivatedEventArgs e)
}
Window.Current.Activate();
UIHelper.SetTitleBarColor();
bool isDisableScale = AppTool.GetBoolSetting(Settings.DisableXboxScale);
if (SystemInformation.DeviceFamily == "Windows.Xbox")
{
var view = ApplicationView.GetForCurrentView();
view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
if (isDisableScale)
ApplicationViewScaling.TrySetDisableLayoutScaling(true);
}
}
catch (Exception ex)
{
Expand Down
2 changes: 1 addition & 1 deletion BiliBili-UWP/BiliBili-UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxPackageDir>E:\Package\BiliBili\</AppxPackageDir>
<AppxPackageDir>D:\Package\BiliBili\</AppxPackageDir>
<GenerateTestArtifacts>False</GenerateTestArtifacts>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm|arm64</AppxBundlePlatforms>
Expand Down
3 changes: 1 addition & 2 deletions BiliBili-UWP/Others/Update.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

更新说明:

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

祝使用愉快,

Expand Down
2 changes: 1 addition & 1 deletion BiliBili-UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Identity
Name="60520B029E250.4264454043325"
Publisher="CN=9EFA2047-A580-400B-A5B2-0C7ABB0DB5C0"
Version="1.3.10.0" />
Version="1.3.11.0" />

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

Expand Down

0 comments on commit 2f2ef6f

Please sign in to comment.