forked from github_mirror/framelesshelper
Update documentation.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
c24fec11ab
commit
14556d8b2d
|
@ -96,13 +96,12 @@ Please refer to <https://github.com/wangwenx190/framelesshelper/issues> for more
|
|||
## Notes for developers
|
||||
|
||||
- As you may have found, if you use this code, the resize areas will be inside the frameless window, however, a normal Win32 window can be resized outside of it. Here is the reason: the `WS_THICKFRAME` window style will cause a window has three transparent areas beside the window's left, right and bottom edge. Their width/height is 8px if the window is not scaled. In most cases, they are totally invisible. It's DWM's responsibility to draw and control them. They exist to let the user resize the window, visually outside of it. They are in the window area, but not the client area, so they are in the non-client area actually. But we have turned the whole window area into client area in `WM_NCCALCSIZE`, so the three transparent resize areas also become a part of the client area and thus they become visible. When we resize the window, it looks like we are resizing inside of it, however, that's because the transparent resize areas are visible now, we ARE resizing outside of the window actually. But I don't know how to make them become transparent again without breaking the frame shadow drawn by DWM. If you really want to solve it, you can try to embed your window into a larger transparent window and draw the frame shadow yourself. [See the discussions here](https://github.com/wangwenx190/framelesshelper/issues/3) for more detailed information.
|
||||
- Don't change the window flags (for example, enable the Qt::FramelessWindowHint flag) because it will break the functionality of this code. I'll get rid of the window frame (including the titlebar of course) in Win32 native events.
|
||||
- All traditional Win32 APIs are replaced by their DPI-aware ones, if there is one.
|
||||
- Starting from Windows 10, normal windows usually have a one pixel width border line. After many times of trying, I still can't preserve it if I want to remove the window frame. I don't know how to solve this currently. If you really need it, you have to draw one manually by yourself. [See the discussions here](https://github.com/wangwenx190/framelesshelper/issues/3) for more detailed information.
|
||||
- The frame shadow will get lost if the window is totally transparent. It can't be solved unless you draw the frame shadow manually.
|
||||
- On Windows 7, if you disabled the Windows Aero, the frame shadow will be disabled as well because it's DWM's resposibility to draw the frame shadow.
|
||||
- The border width (8 if not scaled), border height (8 if not scaled) and titlebar height (30 if not scaled) are acquired by Win32 APIs and are the same with other standard windows, and thus you should not modify them. Only modify them when you really have a good reason to do so.
|
||||
- You can also copy all the code to `[virtual protected] bool QWidget::nativeEvent(const QByteArray &eventType, void *message, long *result)` or `[virtual protected] bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *result)`, it's the same with install a native event filter to the application.
|
||||
- The border width (8px if not scaled), border height (8px if not scaled) and titlebar height (31px if not scaled) are acquired by Win32 APIs and are the same with other standard windows, and thus you should not modify them. Only modify them when you really have a good reason to do so.
|
||||
- You can also copy all the code to `QWidget::nativeEvent()` or `QWindow::nativeEvent()`, it's the same with install a native event filter to the application.
|
||||
|
||||
## References for developers
|
||||
|
||||
|
@ -112,7 +111,6 @@ Please refer to <https://github.com/wangwenx190/framelesshelper/issues> for more
|
|||
|
||||
### Microsoft Docs
|
||||
|
||||
- <https://docs.microsoft.com/en-us/archive/blogs/wpfsdk/custom-window-chrome-in-wpf>
|
||||
- <https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-nccalcsize>
|
||||
- <https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-nchittest>
|
||||
- <https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-ncactivate>
|
||||
|
@ -139,10 +137,10 @@ Please refer to <https://github.com/wangwenx190/framelesshelper/issues> for more
|
|||
|
||||
- <https://github.com/mozilla/gecko-dev/blob/master/widget/windows/nsWindow.cpp>
|
||||
|
||||
### Windows Terminal
|
||||
### Microsoft Terminal
|
||||
|
||||
- <https://github.com/microsoft/terminal/blob/master/src/cascadia/WindowsTerminal/IslandWindow.cpp>
|
||||
- <https://github.com/microsoft/terminal/blob/master/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp>
|
||||
- <https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/IslandWindow.cpp>
|
||||
- <https://github.com/microsoft/terminal/blob/main/src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp>
|
||||
|
||||
### GitHub
|
||||
|
||||
|
|
Loading…
Reference in New Issue