Comments (203)
are you good at QT?
Not very bad at least. But not very professional as well.
create a desktop environment using qt qml
I don't quite understand what does it mean. Can you explain it more clearly?
i mean like a gnome or sway, i was working on a project for creating an os,i finished building up the kernel and i was trying to build the desktop for my os. i have searched and found that it can be done using qtwayland.
from framelesshelper.
This is far more complicated, let's just check our windows 10 acrylic blur itself. if i find a solution to implement acrylic blur i will let you know.
thank you.
from framelesshelper.
Well i ran into another problem, i was able to build the acrylic effect with best quality and no flicker.
Here is the video : https://youtu.be/_SV-s4Q4O1s
(in video it flickers because i was capturing using obs and i have less ram, but it doesn't flicker if obs is off)
but the problem is will not be able to draw anything into the window. whatever i draw in window will be overlapped by the blur resulting this :
i know why does this happen but there is no way i could solve this.
Actually the acrylic i built is rendered by direct composition and direct composition always draws only at the top of the window.
And i reached another dead end.......
from framelesshelper.
@JulienMaille I'm currently working on a private repository to emulate the acrylic effect base on QtitanRibbon's solution. Once it's done, I'll let you know. It's not a simple copy-and-paste so I think there will not be license issues. It's heavily modified to meet my own needs.
PS. It's not perfect indeed, but at least it works, and works on Windows 7 ~ 10. But to get the best appearance, you should use it on Windows 10.
from framelesshelper.
@JulienMaille @selastingeorge The Acrylic Effect has been added to the master branch. You can test it now. Feel free to open new issues if you find anything not correct. It currently only supports Windows 7~10. Support for Linux and macOS may be added later.
can you please post a link to the exe file of that example. i haven't installed QT
from framelesshelper.
Win7, Win8 and Win8.1 are not affected because only from Win10 1803 can the normal Win32 windows enable the Acrylic effect.
from framelesshelper.
The only workaround for this issue is switching back to use the classic blur instead of the Acrylic effect, however, unfortunately, they don't look exactly the same.
Or maybe you can solve this in a pure Qt way: draw the blurred background yourself, through QPainter or whatever.
from framelesshelper.
Maybe @selastingeorge has some ideas? We could freeze the background when moving and disable transparency until it's released?
from framelesshelper.
We could freeze the background when moving and disable transparency until it's released?
I don't have much knowledge about the Acrylic effect. It's a bit beyond my limit.
from framelesshelper.
from framelesshelper.
Ok no problem
@selastingeorge You know how to fix the laggy dragging?
from framelesshelper.
The only way to fix the laggy dragging in acrylic blur is to disable the transparency effect of windows 10 from the personalization settings
from framelesshelper.
and that's a very bad move
from framelesshelper.
i need to find a way to capture the visual behind a window and thats the only way to bring a perfectly working acrylic blur to win32 and wpf
from framelesshelper.
and that's a very bad move
Very bad indeed.
from framelesshelper.
there is one last option, use DWM blur behind capture the hwnd using directx, use gaussian blur from DirectX and redraw it to window
from framelesshelper.
and its a very difficult task
from framelesshelper.
Ah, so complex!
from framelesshelper.
ya microsoft should fix this. have you tried xaml islands
from framelesshelper.
we can use acrylic effect using xaml islands and it is not laggy but flickers a lot.
from framelesshelper.
have you tried xaml islands
I know about it but I don't know whether I can integrate it with Qt or not. I haven't tried it yet. But I think it's not hard to use it in normal Win32 applications, Microsoft's Terminal is a good example.
but flickers a lot.
It's not caused by the xaml island I'm afraid. Maybe it can be solved by your WM_NCCALCSIZE
trick.
from framelesshelper.
no i tried it doesnt work
from framelesshelper.
are you good at QT?
do you have any idea how to create a desktop environment using qt qml
from framelesshelper.
no i tried it doesnt work
So sad.
I'm also wondering why the standard title bar doesn't flicker. It's drawn on the non-client area as what we do, but the title bar drawn by ourselves flicker a lot.
from framelesshelper.
are you good at QT?
Not very bad at least. But not very professional as well.
create a desktop environment using qt qml
I don't quite understand what does it mean. Can you explain it more clearly?
from framelesshelper.
ya windows keeps secrets. the won't let anyone to touch their source codes. if they would have published windows as opensource then windows 10 would be as better as linux.
from framelesshelper.
ya windows keeps secrets. the won't let anyone to touch their source codes. if they would have published windows as opensource then windows 10 would be as better as linux.
Ha ha, sounds sensible.
from framelesshelper.
but i don't know how to create a gridview in qml with multiple selection.
like this image, i need to select multiple items using the rectangle.
from framelesshelper.
i was working on a project for creating an os
Wow, that's awesome!
i was trying to build the desktop for my os
Have you ever heard about the Deepin Desktop Environment (aka DDE) ? It's written in C++/Qt and it's open source. Maybe it can help you. Building a desktop is far beyond my limit😂
from framelesshelper.
Or KDE? It's written in Qt as well.
from framelesshelper.
ya but not fully qml. anyway i will check it out
from framelesshelper.
the Deepin Desktop Environment (aka DDE)
Sorry, I forgot to write the link: https://github.com/linuxdeepin
from framelesshelper.
but not fully qml
I don't think it makes sense to build a desktop environment entirely with QML, as QML is not mature enough and until Qt 5.15 there were still quite a few bugs. If only a few components use QML, this is a good choice.
from framelesshelper.
if i find a solution to implement acrylic blur i will let you know.
Thanks!
from framelesshelper.
The only way to fix the laggy dragging in acrylic blur is to disable the transparency effect of windows 10 from the personalization settings
Yes it fixed the laggy dragging indeed. But the resizing is also very laggy and can't be fixed in this way.
But I have an interesting finding: although I have turned off the transparency effect in the personalization settings, our own Acrylic effect is not affected by it -> it still has the transparency effect. But the dragging is not laggy anymore.
Could this be a breakthrough point?
from framelesshelper.
Ya it wont affect our acrylic effect. i noticed it before and that's why i mentioned it earlier
from framelesshelper.
Maybe there are some APIs (even undocumented APIs) to adjust this, just like SetWindowCompositionAttribute
?
from framelesshelper.
yes there might be.
from framelesshelper.
@selastingeorge See here for more detailed discussion. No solutions yet but at least why the window laggs is known.
from framelesshelper.
@wangwenx190, We have got a good lead, check out this
SetWindowDisplayAffinity
there is a new DWORD value added to this function called WDA_EXCLUDEFROMCAPTURE
, this one help us to exclude a window from screen capture, which means we will be able to capture the visual behind window by just capturing the area where window is placed. now i'm currently working to integrate it.
from framelesshelper.
@wangwenx190, We have got a good lead, check out this
SetWindowDisplayAffinitythere is a new DWORD value added to this function called
WDA_EXCLUDEFROMCAPTURE
, this one help us to exclude a window from screen capture, which means we will be able to capture the visual behind window by just capturing the area where window is placed. now i'm currently working to integrate it.
It’s introduced in win10 2004. Isn’t this too new?
from framelesshelper.
ya but that's the only hope
from framelesshelper.
well i ran into a new problem. it is really tough to understand the dxgi desktop duplication code. it captures the entire desktop. i need to get only the part where my window is placed
from framelesshelper.
ya but that's the only hope
You are right. Let’s fix the issue first.
from framelesshelper.
well i ran into a new problem. it is really tough to understand the dxgi desktop duplication code. it captures the entire desktop. i need to get only the part where my window is placed
https://github.com/robmikh/Win32CaptureSample
https://github.com/robmikh/CaptureGifEncoder
https://github.com/robmikh/SimpleRecorder
They show how to use dxgi to capture windows.
from framelesshelper.
all of these uses winrt and it's well complicated than desktop duplication
from framelesshelper.
any way i'm posting a question in stack overflow i think some one will help us.
from framelesshelper.
I just tried today on my latest insider build and moving isn't laggy anymore. I have not tried for a while on that computer so I can't tell exactly when it was fixed.
from framelesshelper.
from framelesshelper.
@JulienMaille @selastingeorge Great news! Thanks for telling me about this!
from framelesshelper.
the gif doesn't show it so well, but it's smooth
from framelesshelper.
Ya i have seen some post stating the same thing that the acrylic blur is working in insider builds. But they haven't yet rolled it into production.
would be nice to know if we can ship a specific dll in the meantime, or if its a much deeper system fix
from framelesshelper.
Thanks! Looks awesome!
from framelesshelper.
we can ship a specific dll in the meantime
I think it's dangerous. Better to wait for the official fix.
from framelesshelper.
we can ship a specific dll in the meantime
I think it's dangerous. Better to wait for the official fix.
Can you share the links where you've seen other people stating latest insider build has the fix?
from framelesshelper.
from framelesshelper.
@wangwenx190 bad news: resizing is still laggy!
from framelesshelper.
@wangwenx190 bad news: resizing is still laggy!
Previously we can work-around the laggy dragging by disabling the transparent effect, but the resizing is still laggy. So I'm not surprised.
from framelesshelper.
I think the only current way or the better way is to use the xaml islands
@selastingeorge Yes, it is. The best way to use the Acrylic brush in Win32 applications is to use the xaml islands, and that's what Microsoft recommended. There's no laggy dragging and resizing issue when using xaml islands. But for this repo, we are using Qt, and it's rather hard to integrate Qt with xaml islands.
from framelesshelper.
@wangwenx190 did u get flickering while resizing the window on window 10 19042. when i alter the WM_NCCALCSIZE. it flickers one or two times. so i come up with a new way by altering the hbrush of the window class. its perfect and does not flicker at all.
In the 1903 build the dwmExtendFrame... creates a 8px margin around window while maximizing. you can fix this issue also by altering the hbrush of window in createwindowex
from framelesshelper.
i'm doing this in wpf. i was not able to alter the window class in wpf but i altered it by using the setWindowCompositionAttribute(). its undocumented but altering some values bring better options like if we set AccentState to 6 we get a completely transparent window. and a very good news is that from 19042 the acrylic blur is not flickering from this sample:
from framelesshelper.
@wangwenx190 did u get flickering while resizing the window on window 10 19042. when i alter the WM_NCCALCSIZE. it flickers one or two times. so i come up with a new way by altering the hbrush of the window class. its perfect and does not flicker at all.
In the 1903 build the dwmExtendFrame... creates a 8px margin around window while maximizing. you can fix this issue also by altering the hbrush of window in createwindowex
Thanks for telling me this. Your solution may work well for normal windows, however, things are a lot different in Qt. Qt has taken over the responsibility of painting windows. Adjust the brush may not help.
from framelesshelper.
i'm doing this in wpf. i was not able to alter the window class in wpf but i altered it by using the setWindowCompositionAttribute(). its undocumented but altering some values bring better options like if we set AccentState to 6 we get a completely transparent window. and a very good news is that from 19042 the acrylic blur is not flickering from this sample:
That’s a good news indeed! Thanks for telling me this!
from framelesshelper.
@wangwenx190 did u get flickering while resizing the window on window 10 19042. when i alter the WM_NCCALCSIZE. it flickers one or two times. so i come up with a new way by altering the hbrush of the window class. its perfect and does not flicker at all.
In the 1903 build the dwmExtendFrame... creates a 8px margin around window while maximizing. you can fix this issue also by altering the hbrush of window in createwindowexThanks for telling me this. Your solution may work well for normal windows, however, things are a lot different in Qt. Qt has taken over the responsibility of painting windows. Adjust the brush may not help.
Have you tried using WS_EX_NOREDIRECTIONBITMAP in window style. In win32 it removes the content which is drawn using WM_PAINT, but since wpf uses directx we get a fully transparent window with system borders and shadow (it's the perfect window) and is used by UWP Apps. (i inspected using spy++). May be Qt can also do the same thing.
from framelesshelper.
@wangwenx190 did u get flickering while resizing the window on window 10 19042. when i alter the WM_NCCALCSIZE. it flickers one or two times. so i come up with a new way by altering the hbrush of the window class. its perfect and does not flicker at all.
In the 1903 build the dwmExtendFrame... creates a 8px margin around window while maximizing. you can fix this issue also by altering the hbrush of window in createwindowexThanks for telling me this. Your solution may work well for normal windows, however, things are a lot different in Qt. Qt has taken over the responsibility of painting windows. Adjust the brush may not help.
Have you tried using WS_EX_NOREDIRECTIONBITMAP in window style. In win32 it removes the content which is drawn using WM_PAINT, but since wpf uses directx we get a fully transparent window with system borders and shadow (it's the perfect window) and is used by UWP Apps. (i inspected using spy++). May be Qt can also do the same thing.
Yes I've tried that style once, but it doesn't work for Qt. I still got a normal window, nothing changed. But it does work as expected in pure Win32 projects. I tested it in a normal Win32 window and it become totally transparent indeed. I guess Qt doesn't paint in WM_PAINT.
from framelesshelper.
from framelesshelper.
like this :
private enum AccentState
{
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3,
ACCENT_ENABLE_ACRYLICBLURBEHIND = 4,
ACCENT_INVALID_STATE = 5,
ACCENT_DISABLE_REDIRECTIONBITMAP=6
}
from framelesshelper.
The WS_EX_NOREDIRECTIONBITMAP can only be used with CreateWindowEx(). it won't work while using the SetWindowLong()
from framelesshelper.
Quick update, with latest insider build, moving is still ok while resizing is laggy.
The lag when resizing is growing the longer you keep dragging. It really feels like repaint are buffered and processed slower than they are generated. Is there anything that could be done to repaint at a slower rate?
from framelesshelper.
from framelesshelper.
I'm not sure whether there's an appropriate workaround or not.
from framelesshelper.
I prefer waiting for Microsoft to fix the bug officially, although it may be a very long time (and it already is). There are no good workarounds currently in my point of view.
from framelesshelper.
anything interesting in this PR?
https://github.com/qt/qtbase/pull/44/files
from framelesshelper.
anything interesting in this PR?
https://github.com/qt/qtbase/pull/44/files
Not quite sure.
from framelesshelper.
Monthly update: got insider build 21292.1000 and resizing is still laggy
from framelesshelper.
from framelesshelper.
Monthly update: got insider build 21292.1000 and resizing is still laggy
@JulienMaille Thanks for your information!
They are not going to fix this issue any sooner, because there is already a
work around using xaml islands. Like microsoft terminal does
@selastingeorge Maybe you are right, but at least the moving is not laggy any more.
from framelesshelper.
from framelesshelper.
I am working on new acrylic blur effect which is not laggy check this out: https://youtu.be/V-G8s-ol6p4
@selastingeorge It looks quite impressive! How do you achieve that? Is it pure C++ or based on WPF/.NET?
from framelesshelper.
yes its completely working on c++ but i can port it to WPF, it uses direct composition and uses desktop wallpaper as blur input(instead of Host backdrop), later I am going to get the host backdrop using desktop duplication with WDA_EXCLUDEFROMCAPTURE.
Still it's not perfect it in the video above the window is moved along with cursor but if I try dragging the window the blur will start to flicker like this https://youtu.be/bAKCRQdNLjc and that's weird. it is something related to some mathematical calculation I don't know where is the mistake. i have spend a lot of time in it and still no result. now I'm still working on it.
from framelesshelper.
yes its completely working on c++ but i can port it to WPF, it uses direct composition and uses desktop wallpaper as blur input(instead of Host backdrop), later I am going to get the host backdrop using desktop duplication with WDA_EXCLUDEFROMCAPTURE.
Still it's not perfect it in the video above the window is moved along with cursor but if I try dragging the window the blur will start to flicker like this https://youtu.be/bAKCRQdNLjc and that's weird. it is something related to some mathematical calculation I don't know where is the mistake. i have spend a lot of time in it and still no result. now I'm still working on it.
@selastingeorge Thanks for your impressive work! I'm looking forward to your final solution! May I ask will it be open source?
from framelesshelper.
yes of course it will be opensource. I know how hard is to find something like this in internet. I will share the complete source code once it is ready.
from framelesshelper.
but i need more time to fix these issues. till then everyone can use this https://github.com/Microsoft/Windows.UI.Composition-Win32-Samples/tree/master/dotnet/WPF/AcrylicEffect
this one is not laggy anymore.its working fine in my system, i dont have a c++ version of it but i would like to build it
from framelesshelper.
but i need more time to fix these issues. till then everyone can use this https://github.com/Microsoft/Windows.UI.Composition-Win32-Samples/tree/master/dotnet/WPF/AcrylicEffect
this one is not laggy anymore.its working fine in my system, i dont have a c++ version of it but i would like to build it
I'm afriad of it's using some WPF specific technique to avoid laggy. I would like to help you but sadly I'm not able to convert it to C++.
from framelesshelper.
from framelesshelper.
Monthly update: got insider build 21292.1000 and resizing is still laggy
@JulienMaille I think we should not count on this undocumented function anymore. Even if Microsoft fixed it some day in the future, it will require a very recent version of Windows 10, which I think is not acceptable. And it's undocumented API after all, it may become unstable or even totally unusable in the future. I think the best solution is to simulate the Acrylic effect ourself. Let's wait for @selastingeorge 's great work.
from framelesshelper.
Here is the executable : https://firebasestorage.googleapis.com/v0/b/quizbox-f1bb1.appspot.com/o/Debug.zip?alt=media&token=c34323a4-82d0-4064-b74a-d467bef16a6c
from framelesshelper.
Here is the executable : https://firebasestorage.googleapis.com/v0/b/quizbox-f1bb1.appspot.com/o/Debug.zip?alt=media&token=c34323a4-82d0-4064-b74a-d467bef16a6c
It's really impressive! But I don't understand why you can't draw anything on that window. Isn't it an official demo provided by Microsoft? If it has such a severe issue, it would have been fixed by MS already.
from framelesshelper.
from framelesshelper.
I have edited their samples and tried out but no luck. The direct composition always draw on top of the window like the dwm thumbnail does. In uwp they have been drawing everything in window using direct composition so there is no issue. In the case of wpf no luck.
Oh, that's too bad!
from framelesshelper.
@JulienMaille @selastingeorge I have bought QtitanRibbon's source code from Developer Machines, and they are achieveing this by acquiring the wallpaper and blurring it, the appearance is not very bad but I think the performance will not be good, and honestly, the appearance is not very good as well. And it has some issues when running on Windows 7. According to the license I can't show you the source code, but it's not much code, they are using Qt Graphic Effect to do this.
from framelesshelper.
from framelesshelper.
In normal win32 I have done this using direct composition and dwmflush() function. It was working well but the problem was windows airspace issue when I use it in another places such as wpf , I won't be able to draw anything on top of the window. Every content is drawn under the window
Yes I know, you have told me about this.
from framelesshelper.
@JulienMaille @selastingeorge I have bought QtitanRibbon's source code from Developer Machines
That's what I call dedication! Too bad it wasn't worth it. Are you still working on an official Qt patch of this repository?
from framelesshelper.
Too bad it wasn't worth it.
It was not too bad actually. Although their home made acrylic effect is not perfect, I still learned a lot from their source code.
Are you still working on an official Qt patch of this repository?
Yes but the situation now is a bit awkward. In the very beginning, I was trying to introduce a totally new feature called "WindowChrome", I was just adding new stuff to Qt, not modifying any of its original code. It mostly works on Windows because I'm not professional on Linux and macOS. But after some discussions with Qt engineers, I decided to simplify the patch. The reason why we have to write so many code on Windows is we can't use the "Qt::FramelessWindowHint" flag provided by Qt. I tried that flag on Linux KDE and it works fine, the frame shadow is still there, and the animations of windows when they are maximizing or minimizing are preserved as well. So I guess it's a Windows-only issue. The patch now only modified QPA's source code to let Qt::FramelessWindowHint works like other platforms. The code is quite simple, but some unit tests failed so it can't be merged. However I'm not familiar with Qt's unit tests, so the process stuck there.
The patch for Qt: https://codereview.qt-project.org/c/qt/qtbase/+/325649
from framelesshelper.
Thanks, yes I'd be happy to see how you can emulate it!
from framelesshelper.
Thanks, yes I'd be happy to see how you can emulate it!
Good news: making good progress. Bad news: maybe lack support for Linux.
from framelesshelper.
@JulienMaille @selastingeorge The Acrylic Effect has been added to the master branch. You can test it now. Feel free to open new issues if you find anything not correct. It currently only supports Windows 7~10. Support for Linux and macOS may be added later.
from framelesshelper.
can you please post a link to the exe file of that example. i haven't installed QT
@selastingeorge No problem. But how can I send it to you? I have no access to any Google-related services.
from framelesshelper.
just upload it to any links such as onedrive,dropbox,mediafire any one of them or anyplace where i could download the file
from framelesshelper.
Related Issues (20)
- Global::Option::ForceHideWindowFrameBorder causes the frame border to be weird on Windows HOT 10
- 请教关于Qmainwindow的布局问题 HOT 4
- 编译问题 HOT 2
- Qt 6.6.0 Windows Unable to set geometry Issue HOT 3
- qt 6.5.3 窗口拖动改变大小时控件位置不正确 HOT 6
- ubuntu linux下用qt5.15.2版本编译报错
- MacOS最后一个窗口销毁再新建窗口崩溃分析反馈,窗口全屏状态修改分辨率异常问题求助 HOT 5
- Unable to restore window state after minimizing it when using the ApplicationWindow component from Qt controls HOT 3
- Windows下标题栏按钮tooltip重复显示 HOT 3
- closeEvent事件,对QCloseEvent事件进行ignore后,原来无边框的窗体会出现边框 HOT 2
- 把Q_OBJECT包裹在其它宏里面后,qmake编译失败 HOT 1
- quick 最小化问题
- Build error macOS HOT 1
- Build error in apple M1, when Qt is not a universal version.
- 苹果M芯片编译错误 HOT 1
- Win11 5.15.2 main 分支下的 版本
- QOpenGLFunctions 自定义控件显示问题
- 【bug】windows10下最大化和恢复按钮不显示
- 使用 QWebEngineView 之后标题栏按钮无法交互 HOT 18
- 代码问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from framelesshelper.