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

[Feat] Drop shadow on Windows 10 #292

Open
1 task done
ElektroKill opened this issue Sep 20, 2024 · 5 comments
Open
1 task done

[Feat] Drop shadow on Windows 10 #292

ElektroKill opened this issue Sep 20, 2024 · 5 comments
Labels
bug Something isn't working upstream Issues happened on upstreams (Avalonia, Skiasharp...)

Comments

@ElektroKill
Copy link
Contributor

Use the search function to see if this feature has already been suggested.

  • I have searched for duplicate issues.

Description of new feature

It would be nice if the library could offer an option to add the Windows native drop shadow to the windows.
image

This would make windows opened on top of other windows much easier to tell apart visually since the border would be much clearer.

Currently, I find that the windows clash a lot with each other and it's hard to discern their borders.
image

Package Version

6.0.0-beta8

@ElektroKill ElektroKill added the enhancement New feature or request label Sep 20, 2024
@sirdoombox
Copy link
Collaborator

I don't have any other OSs to hand to test this out, native shadows and borders work well on Win11 however.

image

It seems to be an issue with Win10 and custom windows in Avalonia (specifically use of ExtendClientAreaToDecorationsHint="True").

Related discussion about this issue on Avalonia's forums (it's a bit old).

I'd like to know if borders/shadows are an issue on other OSs, especially Linux for future reference.

@ElektroKill
Copy link
Contributor Author

Related Avalonia issue: AvaloniaUI/Avalonia#9989

@sirdoombox sirdoombox added upstream Issues happened on upstreams (Avalonia, Skiasharp...) bug Something isn't working and removed enhancement New feature or request labels Sep 22, 2024
@sirdoombox
Copy link
Collaborator

Seems like it's an Avalonia bug confined to Win10, not a huge amount we can do on our end. Might be some scope to use the DWM API to get the system decorations enabled but it's not something I have the capacity to test.

@kikipoulet
Copy link
Owner

Seems like it's an Avalonia bug confined to Win10, not a huge amount we can do on our end. Might be some scope to use the DWM API to get the system decorations enabled but it's not something I have the capacity to test.

On the other hand, the issue doesn't seem close to being fixed ..

We could do a quick fix in the SukiWindow too :

if (OperatingSystem.IsWindows() && Environment.OSVersion.Version.Build < 22000)
      // Add a Margin and a Dropshadow to SukiWindow Border

But we may look dumb when the original issue will be fixed one day 👀

Alternatively, we could get rid on any system decoration and make one ourselve on SukiWindow, but we'll have to deal with maximized state and a giant shadow that can be a problem performance-wise, as Avalonia clearly doesn't handle it really well.

@sirdoombox
Copy link
Collaborator

Win10 has had it's last update and goes out of support next year, it's pretty reasonable for Avalonia to not spend a huge amount of resources on an OS that's 12 months from EOL.

I think adding a margin to the window itself for Win10 would be fine, but we'd have to handle window maximised etc. and of course the window won't be the "correct" size. Removing all decorations for all platforms would be a pretty horrible idea because we don't have enough XPlat testing in place I think.

If someone with a Win10 install decides to implement/test a solution for this then it's fine, but I don't think we should spend a huge amount of effort doing it otherwise, setting up a VM or multi-booting your work machine just for this fix is a bit excessive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Issues happened on upstreams (Avalonia, Skiasharp...)
Projects
None yet
Development

No branches or pull requests

3 participants