-
Notifications
You must be signed in to change notification settings - Fork 16
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
BUG: Some cleanup is needed when closing the window #1
Comments
Bro, I have noticed the issue about DXGI warning earlier, i think it is from the D3D11, any way I will look into it. and I will also add the dpi awareness. Did you make it work on QT, will you be able to draw anything on top of the acrylic |
Bro I have updated the code, Added DPI Awareness and Fixed the memory leak. |
Thanks for your great work! |
I'm porting this repo to Qt and is making some progress indeed. I'm not able to draw on top of the acrylic either. My solution is creating two windows, one is the real window but have a transparent background, the other is the acrylic window, then place the acrylic window under the real window. I hooked the real window's WndProc function to make the acrylic window sync it's position with the real window. Once it's done, I'll let you know. |
Ya i tried this method with WPF, I was actually able to draw contents on top, but syncing the position is too slow. There is one other way also to overcome this problem. there is an easy way to draw on top of acrylic, there is a method in Direct composition to copy the contents of one window to another I will explain you with a demo.
with this code you can get the content of a window into IDCompositionVisual, in this repo the acrylic is actually rendered to a visual.so it is possible to overlap the window visual on top of acrylic visual. See this part of my code.
Here the AddVisual() adds another visuals into the root visual, the first parameter is the visual to be added, the second parameter is a Boolean which specifies whether to place top of another visual or not. the third parameter is the previous visual.(which means the new visual will overlap the previous visual). This will help you to create the visual of one window and place on top of other, but the both windows should be of the same program (thread) The you must forward all events from one window to another (i mean all click,drag etc..) |
Thanks for your detailed reply, I really learned a lot! But it seems your solution also needs two windows, or am I misunderstand something? |
you need two windows but it will remove the sync delay, it is really fast like DWM Thumbnail, and to reduce the memory usage you can use DWMA_CLOAK attribute for the original window. works really better than overlapping window. Haven't you tried winrt acrylic, its easier than this, i will upload a sample later join here : Discord Channel, we can have a lot of discussions there |
Hi, bro, thanks for the fantastic repo! It's quite impressive!
But when I was debugging this repo in Qt Creator, I got some warning messages when the window is closing:
Looks like some cleanup is needed at window shutdown. Do you have any clue of how to fix it?
BTW, I'm using a 4K monitor and I set scale factor to 250%, I found that the acrylic background is too large. But if I set dpi awareness to PerMonitorV2 programtically, it looks normal again. Maybe you should fix this as well. But using the manifest file is easier.
The text was updated successfully, but these errors were encountered: