kikipoulet / SukiUI

UI Theme for AvaloniaUI
MIT License
1.43k stars 130 forks source link

[Feat] Drop shadow on Windows 10 #292

Open ElektroKill opened 1 month ago

ElektroKill commented 1 month ago

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

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

sirdoombox commented 1 month ago

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 commented 1 month ago

Related Avalonia issue: https://github.com/AvaloniaUI/Avalonia/issues/9989

sirdoombox commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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.