Skip to content

Commit

Permalink
Fix headless window transparency (#16058)
Browse files Browse the repository at this point in the history
* fix headless window transparency

* make the change optional
  • Loading branch information
Rosentti authored Jun 19, 2024
1 parent 4aec7ac commit b718045
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Headless/Avalonia.Headless/HeadlessWindowImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public ILockedFramebuffer Lock()

public Action<WindowTransparencyLevel>? TransparencyLevelChanged { get; set; }

public WindowTransparencyLevel TransparencyLevel => WindowTransparencyLevel.None;
public WindowTransparencyLevel TransparencyLevel { get; set; } = WindowTransparencyLevel.Transparent;

public Action? GotInputWhenDisabled { get; set; }

Expand Down Expand Up @@ -372,7 +372,15 @@ public void SetWindowManagerAddShadowHint(bool enabled)

public void SetTransparencyLevelHint(IReadOnlyList<WindowTransparencyLevel> transparencyLevel)
{

foreach (var item in transparencyLevel)
{
if (item == WindowTransparencyLevel.Transparent) {
TransparencyLevel = item;
return;
}
}

TransparencyLevel = WindowTransparencyLevel.None;
}

public void SetParent(IWindowImpl? parent)
Expand Down

0 comments on commit b718045

Please sign in to comment.