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

WindowStyle None + Enable Transparency true= Exception #131

Closed
TMS-Namespace opened this issue Aug 11, 2021 · 5 comments
Closed

WindowStyle None + Enable Transparency true= Exception #131

TMS-Namespace opened this issue Aug 11, 2021 · 5 comments
Milestone

Comments

@TMS-Namespace
Copy link

TMS-Namespace commented Aug 11, 2021

After upgrading to stable, started getting the exception that above two properties should be on together, although they are indeed both on:

System.InvalidOperationException: 'WindowStyle.None is the only valid value for WindowStyle when AllowsTransparency is true.'

This happens in AcrylicWindow.cs at line:

else if (msg == WM_SIZE && wParam == (IntPtr)SizeEvents.SIZE_RESTORED) { var win = (Window)HwndSource.FromHwnd(hwnd).RootVisual; if (win != null && _internalStateTable.TryGetValue(win, out var internalState)) { win.ClearValue(WindowStyleProperty);

Reverting back only this file to alpha version, removes the exception again.
This happens with .Net core 3.1, Win10.

@TMS-Namespace TMS-Namespace changed the title WindowStyle = None + Enable Transparency= Exception WindowStyle None + Enable Transparency true= Exception Aug 11, 2021
@sourcechord
Copy link
Owner

Thanks for the feedback.
I can reproduce it. But, I think that AllowsTransparency is unnecessary in AcrylicWindow.
What's the porpose of using AllowsTransparency="True"?

@leelds
Copy link

leelds commented Aug 14, 2021

yeah,I think AllowsTransparency="True" is very necessary when I hide current window

@TMS-Namespace
Copy link
Author

@sourcechord I was trying to make rounded corners window… then allow transparency is needed.

@sourcechord
Copy link
Owner

I see 😃
You mean about the comments of following issue?
#111 (comment)
I recognized it, and trying to fix it.
But there is some known issues; acrylic effect is applied to whole window region.

@TMS-Namespace
Copy link
Author

@sourcechord yes I am aware of that issue with rounded corners..

Another note/use case, not sure if it is feasible, opacity dose not work with acrylic, so it is not possible to apply storyboard animation that manipulates it unfortunately…

@sourcechord sourcechord added this to the 0.10.1 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants