Skip to content

Commit

Permalink
Win32: Fix listview cell bounds on Windows.
Browse files Browse the repository at this point in the history
We have to account for the possibility of an MSAA provider on
the header control.
  • Loading branch information
madewokherd committed Dec 17, 2024
1 parent a2db33e commit 224726b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions xalia/Win32/HwndListViewCellProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,19 @@ public override UiDomValue EvaluateIdentifier(UiDomElement element, string ident
var header = ColumnHeader;
if (!(header is null))
{
result = header.EvaluateIdentifier(identifier, Root, depends_on);
if (identifier == "win32_x")
result = header.EvaluateIdentifier("x", Root, depends_on);
else
result = header.EvaluateIdentifier("width", Root, depends_on);
}
}
if (result is UiDomInt && Column == 0) // identifier == "win32_width"
{
// Sometimes selectbounds spans multiple columns (wine bug?)
Row.Element.EvaluateIdentifier("win32_selectbounds_x", Root, depends_on).TryToInt(out var sb_x);
Row.Element.EvaluateIdentifier("win32_selectbounds_width", Root, depends_on).TryToInt(out var sb_width);
ColumnHeader.EvaluateIdentifier("win32_x", Root, depends_on).TryToInt(out var header_x);
ColumnHeader.EvaluateIdentifier("win32_width", Root, depends_on).TryToInt(out var header_width);
ColumnHeader.EvaluateIdentifier("x", Root, depends_on).TryToInt(out var header_x);
ColumnHeader.EvaluateIdentifier("width", Root, depends_on).TryToInt(out var header_width);
return new UiDomInt(Math.Min(header_x + header_width - sb_x, sb_width));
}
return result;
Expand Down

0 comments on commit 224726b

Please sign in to comment.