Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use new SpanningRects API instead of DisplayRegions. #1822

Merged
merged 2 commits into from
Jan 9, 2020

Conversation

teaP
Copy link
Contributor

@teaP teaP commented Jan 8, 2020

Shell added a new API called SpanningRects, which is to replace DisplayRegions, so I'm updating TwoPaneView. Since it's not in the released SDK yet, I added the API to my own idl temporarily. Verified that it works on the latest VM in both double landscape and double portrait, when spanning and unspanning. It's necessary to listen to Window.SizeChanged because it fires at the right time when unspanning; shell may have further work to do on a timing here.

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jan 8, 2020
@kmahone kmahone added area-TwoPaneView team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jan 8, 2020
@@ -26,6 +26,7 @@ TwoPaneView::TwoPaneView()
SetDefaultStyleKey(this);

SizeChanged({ this, &TwoPaneView::OnSizeChanged });
winrt::Window::Current().SizeChanged({ this, &TwoPaneView::OnWindowSizeChanged });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

winrt::Window::Current().SizeChanged({ this, &TwoPaneView::OnWindowSizeChanged }); [](start = 4, length = 82)

I think this is not island friendly, I think we need to use appwindow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dual-screen part of TwoPaneView doesn't work in islands, because we are tied to app view. Comp/shell work needs to be done in order for us to be able to be island-friendly.

Copy link
Contributor

@StephenLPeters StephenLPeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

return s_isApplicationViewGetDisplayRegionsAvailable;
static bool s_isApplicationViewGetSpanningRectsAvailable =
winrt::ApiInformation::IsMethodPresent(L"Windows.UI.ViewManagement.ApplicationView", L"GetSpanningRects");
return s_isApplicationViewGetSpanningRectsAvailable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiInformation checks aren't cheap, can we just use the QueryInterface as the gateway and delete this helper? If we can't QI for the special interface then it doesn't matter what the metadata says.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

@teaP teaP merged commit d876b4e into master Jan 9, 2020
@teaP teaP deleted the user/teaP/TwoPaneViewSpanning branch January 9, 2020 21:46
ranjeshj pushed a commit that referenced this pull request Feb 4, 2020
* Update to use new SpanningRects API instead of DisplayRegions.
ranjeshj pushed a commit that referenced this pull request Feb 9, 2020
* Update to use new SpanningRects API instead of DisplayRegions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TwoPaneView team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants