Skip to content

Commit

Permalink
Check for ApplicationViewMode.Spanning. (#1928)
Browse files Browse the repository at this point in the history
  • Loading branch information
teaP authored Feb 4, 2020
1 parent 1c09f51 commit c482f06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dev/TwoPaneView/DisplayRegionHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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<winrt::IApplicationViewSpanningRects>())
{
Expand Down

0 comments on commit c482f06

Please sign in to comment.