Skip to content

Commit

Permalink
Merge branch 'winui3/release/1.6-stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
reunion-maestro-bot committed Oct 1, 2024
2 parents 35c590b + f31293f commit d4aca7d
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 15 deletions.
13 changes: 12 additions & 1 deletion src/dxaml/xcp/components/FocusRect/RevealFocusSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@
#include "RevealFocusDefaultValue.h"
#include "RootScale.h"
#include <FxCallbacks.h>
#include <FrameworkUdk/Containment.h>

using namespace DirectUI;
using namespace RevealFocus;

using wrl_wrappers::HStringReference;

#define WINAPPSDK_CHANGEID_53858715 53858715

namespace FocusRect {

template<typename LightInterface>
Expand Down Expand Up @@ -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<int64_t>(spotLightSpeed)) };

if (WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_53858715>())
{
return wf::TimeSpan { static_cast<int64_t>(HNS_FROM_SECOND(spotLightSpeed)) };
}
else
{
return wf::TimeSpan { HNS_FROM_SECOND(static_cast<int64_t>(spotLightSpeed)) };
}
}

float RevealFocusSource::GetTravelingDistance(_In_ DirectUI::FocusNavigationDirection direction) const
Expand Down
2 changes: 2 additions & 0 deletions src/dxaml/xcp/core/inc/XamlIslandRoot.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ class CXamlIslandRoot final : public CPanel
typedef decltype(&CXamlIslandRoot::OnIslandNonClientPointerEntered) PointerHandlerFunction;
wrl::ComPtr<wf::ITypedEventHandler<ixp::InputNonClientPointerSource*, ixp::NonClientPointerEventArgs*>> GetNonClientPointerEventHandler(PointerHandlerFunction pointerHandler, std::optional<bool> newContactState = std::optional<bool>());

_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);
Expand Down
18 changes: 17 additions & 1 deletion src/dxaml/xcp/dxaml/lib/AppBar_Partial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#include "XamlRoot.g.h"
#include "ElementSoundPlayerService_Partial.h"

#include <FrameworkUdk/Containment.h>

// 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;

Expand Down Expand Up @@ -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<WINAPPSDK_CHANGEID_53845452>())
{
// 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;
}

Expand Down
35 changes: 32 additions & 3 deletions src/dxaml/xcp/dxaml/lib/ContentDialog_Partial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
#include "ElementSoundPlayerService_Partial.h"
#include "XamlTelemetry.h"

#include <FrameworkUdk/Containment.h>

// 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

Expand All @@ -63,10 +69,13 @@ ContentDialog::~ContentDialog()
{
VERIFYHR(DetachEventHandlers());

auto xamlRoot = XamlRoot::GetForElementStatic(this);
if (m_xamlRootChangedEventHandler && xamlRoot)
if (!WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_53870041>())
{
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())
Expand Down Expand Up @@ -786,6 +795,15 @@ ContentDialog::ShowAsyncWithPlacementImpl(
IFC_RETURN(PrepareContent());
}

if (WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_53870041>())
{
// 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
Expand Down Expand Up @@ -1836,6 +1854,17 @@ _Check_return_ HRESULT ContentDialog::DetachEventHandlers()
}
}

if (WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_53870041>())
{
if (auto xamlRoot = XamlRoot::GetForElementStatic(this))
{
if (m_xamlRootChangedEventHandler)
{
IFC_RETURN(m_xamlRootChangedEventHandler.DetachEventHandler(xamlRoot.Get()));
}
}
}

return S_OK;
}

Expand Down
20 changes: 10 additions & 10 deletions src/eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<!-- Copyright (c) Microsoft Corporation. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.WindowsAppSDK.Foundation.TransportPackage" Version="1.6.0-20240828.0.release">
<Dependency Name="Microsoft.WindowsAppSDK.Foundation.TransportPackage" Version="1.6.0-20240920.1.release">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDK</Uri>
<Sha>899f2c5ad470039ce07b6182a35efc2048d5682d</Sha>
<Sha>6b2791467236dc1325d58c7f44fccbabd1c90189</Sha>
</Dependency>
<Dependency Name="Microsoft.ProjectReunion.InteractiveExperiences.TransportPackage" Version="1.6.4-CI-26107.1010.240827-1251.1">
<Dependency Name="Microsoft.ProjectReunion.InteractiveExperiences.TransportPackage" Version="1.6.4-CI-26107.1011.240916-1439.0">
<Uri>https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP</Uri>
<Sha>2755c21b3b1bad26019e8a8d721f1675c2685720</Sha>
<Sha>943a920dac1612ac395a09f42af287a08e6eddac</Sha>
</Dependency>
<Dependency Name="Microsoft.Internal.InteractiveExperiences" Version="1.6.4-CI-26107.1010.240827-1251.1">
<Dependency Name="Microsoft.Internal.InteractiveExperiences" Version="1.6.4-CI-26107.1011.240916-1439.0">
<Uri>https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP</Uri>
<Sha>2755c21b3b1bad26019e8a8d721f1675c2685720</Sha>
<Sha>943a920dac1612ac395a09f42af287a08e6eddac</Sha>
</Dependency>
<!-- Microsoft-WinUI-SDK subdirectory in WindowsAppSDKClosed (MSBuild and Visual Studio extensions for building, deploying, and debugging packaged applications.) -->
<Dependency Name="Microsoft.Build.Msix" Version="1.6.0-stable.20240815.1">
<Dependency Name="Microsoft.Build.Msix" Version="1.6.0-release.20240918.3">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKClosed</Uri>
<Sha>7bfb1cc50ee677ea7e99599de28f842bac2f93e5</Sha>
<Sha>f46219627990ea87389c046b665854f6e794bc49</Sha>
</Dependency>
<!-- Closed source binary (ex PTLS and WinUIEdit) -->
<Dependency Name="Microsoft.Internal.WinUIDetails" Version="1.610.0-stable.20240815.1">
<Dependency Name="Microsoft.Internal.WinUIDetails" Version="1.610.0-release.20240918.3">
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKClosed</Uri>
<Sha>7bfb1cc50ee677ea7e99599de28f842bac2f93e5</Sha>
<Sha>f46219627990ea87389c046b665854f6e794bc49</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down

0 comments on commit d4aca7d

Please sign in to comment.