From c482f06594477ad636148e173bc518c970e8ccd0 Mon Sep 17 00:00:00 2001 From: T Paine <30241445+teaP@users.noreply.github.com> Date: Mon, 3 Feb 2020 16:00:04 -0800 Subject: [PATCH] Check for ApplicationViewMode.Spanning. (#1928) --- dev/TwoPaneView/DisplayRegionHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/TwoPaneView/DisplayRegionHelper.cpp b/dev/TwoPaneView/DisplayRegionHelper.cpp index 47ebfa6ec5..4229c36c5d 100644 --- a/dev/TwoPaneView/DisplayRegionHelper.cpp +++ b/dev/TwoPaneView/DisplayRegionHelper.cpp @@ -8,6 +8,9 @@ #include "DisplayRegionHelper.h" #include "LifetimeHandler.h" +// TODO: Remove once ApplicationViewMode::Spanning is available in the SDK +const int c_ApplicationViewModeSpanning = 2; + /* static */ DisplayRegionHelperInfo DisplayRegionHelper::GetRegionInfo() { @@ -45,7 +48,7 @@ DisplayRegionHelperInfo DisplayRegionHelper::GetRegionInfo() view = winrt::ApplicationView::GetForCurrentView(); } catch(...) {} - if (view) + if (view && view.ViewMode() == (winrt::Windows::UI::ViewManagement::ApplicationViewMode)c_ApplicationViewModeSpanning) { if (const auto appView = view.try_as()) {