[Feat] Drop shadow on Windows 10
Opened this issue · 5 comments
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.
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.
Package Version
6.0.0-beta8
I don't have any other OSs to hand to test this out, native shadows and borders work well on Win11 however.
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.
Related Avalonia issue: AvaloniaUI/Avalonia#9989
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.
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.
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.