WinNativeEventFilter:
1. Removed all unused functions and macros.
Win32 API prototypes are not touched because
we may still need them in the future.
2. Don't store data through SetWindowLongPtrW,
using dynamic properties of QWindow instead.
People may rely on GetWindowLongPtrW(hwnd, GWLP_USERDATA)
to do their own work.
3. Some helper functions are removed, such as
moveWindowToDesktopCenter(). You can implement them
yourself. Keep them in the source code will keep
pulling in new dependencies so I have to get rid
of them.
4. Some blocks are removed, such as WM_GETMINMAXIINFO.
It's not needed. You can call Qt's standard API now,
such as setMaximumSize() and setMinimumSize().
FramelessQuickHelper:
1. Removed all functions that can be replaced by Qt's
own API, such as setMaximumSize() and setMinimumSize().
2. Removed helper functions, such as moveWindowToDesktopCenter().
You can implement them yourself. Just few lines of code.
FramelessWindowsManager:
Adapt to the above changes.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit totally removed the dependency of the widgets
and quick modules for the Windows platform. Now the library
itself only depends on the core and gui modules. Currently
no bug can be found. But there are some side effects: one is
we can't set a palette for a widget due to we can't access
QWidget specific functions so if you want to enable blur
effect, you will have to do this by yourself. Another one is
you now have to pass the window handle to WinNativeEventFilter
instead of the pointer of a QObject. Before this patch, I'm
using QWidget::winId() to get the window handle, now we have
get rid of the widgets dependency so I can't get the window
handle now, you have to pass it explicitly. And it leads to
huge refactoring of the whole repository. But I think it's
worth doing. If anyone knows how to get the window handle
without introducing new dependencies, please tell me. It will
help me a lot.
To remove the quick dependency, the FramelessQuickHelper class
is moved out of the library now. If your project needs it,
please copy the files to your project and include them directly.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. The border color on Win10 when in light theme is also #707070, not pure white.
2. The brush color of the Acrylic effect is reversed before, it is now correct.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. Use QList instead of QVector because QVector will become an alias of QList since Qt6.
2. Don't use *const because the account of const is too large.
3. New style applied, by Clang Format.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. Remove window handle from WINDOW, it's useless now.
2. Rename variables in WINDOWDATA to match their real usage.
3. Do not enable layered window by default, it's causing problems.
4. Add a progress bar to the QQPlayer example.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
If a window is in fullscreen mode, it should not have a title bar.
Maybe a rare use case, but better than nothing.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
Restoring window styles to default will break Qt Quick applications.
The QWindow will disappear once we do it.
Qt Widgets applications are not affected.
Don't know why currently.
Disable it by default because it's not something we must do.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. Use const more.
2. Add some missing ResolveWin32APIs() call
3. Move updateQtFrame to WinNativeEventFilter
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
1. Add more comments.
2. Add a function to change window geometry through Win32 API/
3. Add a function to move the window to the center of the desktop.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
We will use the original solution in this branch.
The new Windows Terminal solution will be in another branch.
Partially reverts commit 01707907cd
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
Don't remove the window frame totally, only remove the title bar instead
(including the top border).
We can resize outside our window just like any other normal window in
this way. And many strange problems caused by the removal of window
frame are gone such as background flicker.
However, we will need to paint the top frame border ourself. Otherwise
the window doesn't look very good.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>