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

fix: Ensure WPF adheres to physical Position and Size on AppWindow (backport #18637) #18684

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: Formatting
(cherry picked from commit df49378)
  • Loading branch information
MartinZikmund authored and mergify[bot] committed Nov 4, 2024
commit b6af3240b36801b0cf5827d02d10ebad557dae99
6 changes: 3 additions & 3 deletions src/Uno.UI.Runtime.Skia.Wpf/UI/Controls/WpfWindowWrapper.cs
Original file line number Diff line number Diff line change
@@ -45,18 +45,18 @@ private void UpdateSizeFromNative()
{
if (!_wasShown)
{
Size = new() { Width = (int)(_wpfWindow.Width * RasterizationScale), Height = (int)(_wpfWindow.Height * RasterizationScale)};
Size = new() { Width = (int)(_wpfWindow.Width * RasterizationScale), Height = (int)(_wpfWindow.Height * RasterizationScale) };
}
else
{
Size = new() { Width = (int)(_wpfWindow.ActualWidth * RasterizationScale), Height = (int)(_wpfWindow.ActualHeight * RasterizationScale)};
Size = new() { Width = (int)(_wpfWindow.ActualWidth * RasterizationScale), Height = (int)(_wpfWindow.ActualHeight * RasterizationScale) };
}
}

private void OnNativeLocationChanged(object? sender, EventArgs e) => UpdatePositionFromNative();

private void UpdatePositionFromNative() =>
Position = new() { X = (int)(_wpfWindow.Left * RasterizationScale), Y = (int)(_wpfWindow.Top * RasterizationScale)};
Position = new() { X = (int)(_wpfWindow.Left * RasterizationScale), Y = (int)(_wpfWindow.Top * RasterizationScale) };

private void OnNativeStateChanged(object? sender, EventArgs e) => UpdateIsVisible();