diff --git a/src/dxaml/xcp/components/FocusRect/RevealFocusSource.cpp b/src/dxaml/xcp/components/FocusRect/RevealFocusSource.cpp index e249eaaf3e..fc1486a903 100644 --- a/src/dxaml/xcp/components/FocusRect/RevealFocusSource.cpp +++ b/src/dxaml/xcp/components/FocusRect/RevealFocusSource.cpp @@ -26,12 +26,15 @@ #include "RevealFocusDefaultValue.h" #include "RootScale.h" #include +#include using namespace DirectUI; using namespace RevealFocus; using wrl_wrappers::HStringReference; +#define WINAPPSDK_CHANGEID_53858715 53858715 + namespace FocusRect { template @@ -488,7 +491,15 @@ bool RevealFocusSource::IsTravelingFocusEnabled(_In_ DirectUI::FocusNavigationDi wf::TimeSpan RevealFocusSource::GetSpotLightDuration(_In_ DirectUI::FocusNavigationDirection direction) const { const float spotLightSpeed = GetTravelingDistance(direction) / GetDefaultValue(DefaultValue::SpotLightSpeed); - return wf::TimeSpan { HNS_FROM_SECOND(static_cast(spotLightSpeed)) }; + + if (WinAppSdk::Containment::IsChangeEnabled()) + { + return wf::TimeSpan { static_cast(HNS_FROM_SECOND(spotLightSpeed)) }; + } + else + { + return wf::TimeSpan { HNS_FROM_SECOND(static_cast(spotLightSpeed)) }; + } } float RevealFocusSource::GetTravelingDistance(_In_ DirectUI::FocusNavigationDirection direction) const diff --git a/src/dxaml/xcp/core/inc/XamlIslandRoot.h b/src/dxaml/xcp/core/inc/XamlIslandRoot.h index 0f84e64c1d..4aba80f619 100644 --- a/src/dxaml/xcp/core/inc/XamlIslandRoot.h +++ b/src/dxaml/xcp/core/inc/XamlIslandRoot.h @@ -279,6 +279,8 @@ class CXamlIslandRoot final : public CPanel typedef decltype(&CXamlIslandRoot::OnIslandNonClientPointerEntered) PointerHandlerFunction; wrl::ComPtr> GetNonClientPointerEventHandler(PointerHandlerFunction pointerHandler, std::optional newContactState = std::optional()); + _Check_return_ HRESULT ConvertNonClientPointToXamlCoordinates(wf::Point& point); + bool IsDisposed() const { return m_contentRoot == nullptr; } void UpdateLastPointerPointForReplay(const UINT uMsg, _In_ ixp::IPointerPoint* pointerPoint, _In_opt_ ixp::IPointerEventArgs* pointerEventArgs, bool previousPointerPointIsNonClient = false); diff --git a/src/dxaml/xcp/dxaml/lib/AppBar_Partial.cpp b/src/dxaml/xcp/dxaml/lib/AppBar_Partial.cpp index 2ae83c3dc4..e754656620 100644 --- a/src/dxaml/xcp/dxaml/lib/AppBar_Partial.cpp +++ b/src/dxaml/xcp/dxaml/lib/AppBar_Partial.cpp @@ -27,6 +27,12 @@ #include "XamlRoot.g.h" #include "ElementSoundPlayerService_Partial.h" +#include + +// Bug 53617690: [(GE)WCD_ON][2024.09A][Compat][OS Issue][File explorer]: The context menu appears upside when clicking "See more" in Windows File Explorer. +// Bug 53845452: [1.6 servicing] [(GE)WCD_ON][2024.09A][Compat][OS Issue][File explorer]: The context menu appears upside when clicking "See more" in Windows File Explorer. +#define WINAPPSDK_CHANGEID_53845452 53845452 + using namespace DirectUI; using namespace std::placeholders; @@ -1435,7 +1441,17 @@ _Check_return_ HRESULT AppBar::HasSpaceForAppBarToOpenDown(_Out_ bool* hasSpace) layoutBounds.X -= windowBounds.X; layoutBounds.Y -= windowBounds.Y; - *hasSpace = (bottomOfExpandedAppBar.Y <= layoutBounds.Y + layoutBounds.Height); + auto bottomOfLayout = layoutBounds.Y + layoutBounds.Height; + + if (WinAppSdk::Containment::IsChangeEnabled()) + { + // Pixel rounding can sometimes cause the bounds and AppBar size to be off by a pixel when we expect them to be equal. + // To account for that possibility, we'll allow the AppBar to open down if its height is at most one pixel greater + // than the layout bounds height. + bottomOfLayout += 1; + } + + *hasSpace = (bottomOfExpandedAppBar.Y <= bottomOfLayout); return S_OK; } diff --git a/src/dxaml/xcp/dxaml/lib/ContentDialog_Partial.cpp b/src/dxaml/xcp/dxaml/lib/ContentDialog_Partial.cpp index be2e91094b..2228e85cfb 100644 --- a/src/dxaml/xcp/dxaml/lib/ContentDialog_Partial.cpp +++ b/src/dxaml/xcp/dxaml/lib/ContentDialog_Partial.cpp @@ -46,6 +46,12 @@ #include "ElementSoundPlayerService_Partial.h" #include "XamlTelemetry.h" +#include + +// Bug 53719202: [Regression] [WinAppSdk v1.6 | Extra Unload call] After instantiating a custom dialog, it will immediately raises Unloaded event +// Bug 53870041: [1.6 servicing] [Regression] [WinAppSdk v1.6 | Extra Unload call] After instantiating a custom dialog, it will immediately raises Unloaded event +#define WINAPPSDK_CHANGEID_53870041 53870041 + #undef min #undef max @@ -63,10 +69,13 @@ ContentDialog::~ContentDialog() { VERIFYHR(DetachEventHandlers()); - auto xamlRoot = XamlRoot::GetForElementStatic(this); - if (m_xamlRootChangedEventHandler && xamlRoot) + if (!WinAppSdk::Containment::IsChangeEnabled()) { - VERIFYHR(m_xamlRootChangedEventHandler.DetachEventHandler(xamlRoot.Get())); + auto xamlRoot = XamlRoot::GetForElementStatic(this); + if (m_xamlRootChangedEventHandler && xamlRoot) + { + VERIFYHR(m_xamlRootChangedEventHandler.DetachEventHandler(xamlRoot.Get())); + } } if (auto popup = m_tpPopup.GetSafeReference()) @@ -786,6 +795,15 @@ ContentDialog::ShowAsyncWithPlacementImpl( IFC_RETURN(PrepareContent()); } + if (WinAppSdk::Containment::IsChangeEnabled()) + { + // We need to explicitly apply the template here to avoid a bug where applying the template + // during a measure pass causes us to erroneously raise the Unloaded event immediately after + // the Loaded event. + BOOLEAN ignore = FALSE; + IFC_RETURN(ApplyTemplate(&ignore)); + } + IFC_RETURN(HostDialogWithinPopup(false /*wasSmokeLayerFoundAsTemplatePart*/)); // Defer actually opening the ContentDialog's popup by a tick to enable @@ -1836,6 +1854,17 @@ _Check_return_ HRESULT ContentDialog::DetachEventHandlers() } } + if (WinAppSdk::Containment::IsChangeEnabled()) + { + if (auto xamlRoot = XamlRoot::GetForElementStatic(this)) + { + if (m_xamlRootChangedEventHandler) + { + IFC_RETURN(m_xamlRootChangedEventHandler.DetachEventHandler(xamlRoot.Get())); + } + } + } + return S_OK; } diff --git a/src/eng/Version.Details.xml b/src/eng/Version.Details.xml index dc05f67eff..a36df7cf3c 100644 --- a/src/eng/Version.Details.xml +++ b/src/eng/Version.Details.xml @@ -2,27 +2,27 @@ - + https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDK - 899f2c5ad470039ce07b6182a35efc2048d5682d + 6b2791467236dc1325d58c7f44fccbabd1c90189 - + https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP - 2755c21b3b1bad26019e8a8d721f1675c2685720 + 943a920dac1612ac395a09f42af287a08e6eddac - + https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP - 2755c21b3b1bad26019e8a8d721f1675c2685720 + 943a920dac1612ac395a09f42af287a08e6eddac - + https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKClosed - 7bfb1cc50ee677ea7e99599de28f842bac2f93e5 + f46219627990ea87389c046b665854f6e794bc49 - + https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKClosed - 7bfb1cc50ee677ea7e99599de28f842bac2f93e5 + f46219627990ea87389c046b665854f6e794bc49