Fix Linux build.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
ae92a00628
commit
c0de790138
|
@ -4,6 +4,7 @@ DEFINES += \
|
|||
QT_NO_CAST_FROM_ASCII \
|
||||
QT_NO_CAST_TO_ASCII \
|
||||
FRAMELESSHELPER_STATIC
|
||||
RESOURCES += $$PWD/resources.qrc
|
||||
HEADERS += \
|
||||
$$PWD/../framelesshelper_global.h \
|
||||
$$PWD/../framelesswindowsmanager.h
|
||||
|
@ -18,7 +19,6 @@ win32 {
|
|||
DEFINES += WNEF_LINK_SYSLIB
|
||||
LIBS += -luser32 -lgdi32 -ldwmapi -lshcore -ld2d1
|
||||
}
|
||||
RESOURCES += $$PWD/windows.qrc
|
||||
RC_FILE = $$PWD/windows.rc
|
||||
OTHER_FILES += $$PWD/windows.manifest
|
||||
} else {
|
||||
|
|
|
@ -81,7 +81,7 @@ FramelessHelper::FramelessHelper(QObject *parent) : QObject(parent) {}
|
|||
void FramelessHelper::updateQtFrame(QWindow *window, const int titleBarHeight)
|
||||
{
|
||||
Q_ASSERT(window);
|
||||
if (titleBarHeight > 0) {
|
||||
if (titleBarHeight >= 0) {
|
||||
// Reduce top frame to zero since we paint it ourselves. Use
|
||||
// device pixel to avoid rounding errors.
|
||||
const QMargins margins = {0, -titleBarHeight, 0, 0};
|
||||
|
@ -292,7 +292,10 @@ void FramelessHelper::removeWindowFrame(QObject *obj, const bool center)
|
|||
// disabled.
|
||||
widget->setMouseTracking(true);
|
||||
widget->installEventFilter(this);
|
||||
updateQtFrame(widget->windowHandle(), m_titleBarHeight);
|
||||
QWindow *window = widget->windowHandle();
|
||||
if (window) {
|
||||
updateQtFrame(window, m_titleBarHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue