Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#6044 from AvaloniaUI/fixes/failing-debu…
Browse files Browse the repository at this point in the history
…g-build-tests

Fix a couple of tests that only fail in debug mode.
  • Loading branch information
grokys authored and Washi1337 committed Jun 11, 2021
2 parents 2b294ea + 8d0ba61 commit bef43fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 13 additions & 6 deletions src/Avalonia.X11/X11Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -994,15 +994,22 @@ public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e)
side = NetWmMoveResize._NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT;
BeginMoveResize(side, e);
}

public void SetTitle(string title)
{
var data = Encoding.UTF8.GetBytes(title);
fixed (void* pdata = data)
if (string.IsNullOrEmpty(title))
{
XChangeProperty(_x11.Display, _handle, _x11.Atoms._NET_WM_NAME, _x11.Atoms.UTF8_STRING, 8,
PropertyMode.Replace, pdata, data.Length);
XStoreName(_x11.Display, _handle, title);
XDeleteProperty(_x11.Display, _handle, _x11.Atoms._NET_WM_NAME);
}
else
{
var data = Encoding.UTF8.GetBytes(title);
fixed (void* pdata = data)
{
XChangeProperty(_x11.Display, _handle, _x11.Atoms._NET_WM_NAME, _x11.Atoms.UTF8_STRING, 8,
PropertyMode.Replace, pdata, data.Length);
XStoreName(_x11.Display, _handle, title);
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Avalonia.Visuals.UnitTests/Media/PenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public void Adding_DashStyle_Dashes_Raises_Invalidated()
}

[Fact]
public void Equality_Is_Implemented_Between_Immutable_And_Mmutable_Pens()
public void Equality_Is_Implemented_Between_Immutable_And_Mutable_Pens()
{
var brush = new SolidColorBrush(Colors.Red);
var brush = new ImmutableSolidColorBrush(Colors.Red);
var target1 = new ImmutablePen(
brush: brush,
thickness: 2,
Expand All @@ -83,7 +83,7 @@ public void Equality_Is_Implemented_Between_Immutable_And_Mmutable_Pens()
[Fact]
public void Equality_Is_Implemented_Between_Mutable_And_Immutable_DashStyles()
{
var brush = new SolidColorBrush(Colors.Red);
var brush = new ImmutableSolidColorBrush(Colors.Red);
var target1 = new ImmutablePen(
brush: brush,
thickness: 2,
Expand Down

0 comments on commit bef43fc

Please sign in to comment.