Skip to content

Commit

Permalink
Merge pull request #17973 from Youssef1313/maximize-issue
Browse files Browse the repository at this point in the history
fix: Maximizing causes the app to not be responsive
  • Loading branch information
Youssef1313 authored Aug 19, 2024
2 parents 3295c52 + 35faeee commit 4396251
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ public async Task When_CornerRadius()
[DataRow(true, true)]
[DataRow(false, true)]
[DataRow(false, false)]
public async Task When_Border_CorderRadius_HitTesting(bool addBorderChild, bool addGridBackground)
public async Task When_Border_CornerRadius_HitTesting(bool addBorderChild, bool addGridBackground)
{
var borderPressedCount = 0;
var rectanglePressedCount = 0;
Expand Down
8 changes: 6 additions & 2 deletions src/Uno.UI/UI/Xaml/Controls/Border/Border.cs
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,18 @@ protected override void OnBackgroundChanged(DependencyPropertyChangedEventArgs e

internal override bool IsViewHit() => IsViewHitImpl(this);

internal static bool IsViewHitImpl(FrameworkElement element)
internal static bool IsViewHitImpl(IBorderInfoProvider element)
{
_Debug.Assert(element is Panel
|| element is Border
|| element is ContentPresenter
);

return element.Background != null;
return element.Background != null
#if __SKIA__
|| element.BorderBrush != null
#endif
;
}

#if !UNO_HAS_BORDER_VISUAL
Expand Down
9 changes: 3 additions & 6 deletions src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,13 @@ internal static (UIElement? element, Branch? stale) SearchDownForTopMostElementA

// We didn't find any child at the given position, validate that element can be touched,
// and the position is in actual bounds(which might be different than the clipping bounds)
#if __SKIA__
if (renderingBounds.Contains(testPosition) && element.HitTest(transformToElement.Inverse().Transform(testPosition)))
#else

if (elementHitTestVisibility == HitTestability.Visible && renderingBounds.Contains(testPosition)
#if __WASM__
#if __SKIA__
&& element.HitTest(transformToElement.Inverse().Transform(testPosition))
#elif __WASM__
&& element.HitTest(testPosition)
#endif
)
#endif
{
TRACE($"> LEAF! ({element.GetDebugName()} is the OriginalSource) | stale branch: {stale?.ToString() ?? "-- none --"}");
return (element, stale);
Expand Down

0 comments on commit 4396251

Please sign in to comment.