-
Notifications
You must be signed in to change notification settings - Fork 706
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
Conversation
@@ -26,6 +26,7 @@ TwoPaneView::TwoPaneView() | |||
SetDefaultStyleKey(this); | |||
|
|||
SizeChanged({ this, &TwoPaneView::OnSizeChanged }); | |||
winrt::Window::Current().SizeChanged({ this, &TwoPaneView::OnWindowSizeChanged }); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dev/dll/SharedHelpers.cpp
Outdated
return s_isApplicationViewGetDisplayRegionsAvailable; | ||
static bool s_isApplicationViewGetSpanningRectsAvailable = | ||
winrt::ApiInformation::IsMethodPresent(L"Windows.UI.ViewManagement.ApplicationView", L"GetSpanningRects"); | ||
return s_isApplicationViewGetSpanningRectsAvailable; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure!
* Update to use new SpanningRects API instead of DisplayRegions.
* Update to use new SpanningRects API instead of DisplayRegions.
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.