Compare commits

..

No commits in common. "85a3fe1b2f718ff94f83833241c202ee9ef9908a" and "79a9327c01e55f0a44812b6c09bd21e977d028ec" have entirely different histories.

55 changed files with 79 additions and 83 deletions

View File

@ -221,20 +221,6 @@ add_project_config(KEY "system_button" CONDITION NOT FRAMELESSHELPER_NO_SYSTEM_B
add_project_config(KEY "native_impl" CONDITION FRAMELESSHELPER_NATIVE_IMPL)
generate_project_config(PATH "${FRAMELESSHELPER_CONFIG_FILE}")
function(setup_custom_moc_macros)
cmake_parse_arguments(arg "" "" "TARGETS" ${ARGN})
if(arg_UNPARSED_ARGUMENTS)
message(AUTHOR_WARNING "setup_custom_moc_macros: Unrecognized arguments: ${arg_UNPARSED_ARGUMENTS}")
endif()
foreach(__target ${arg_TARGETS})
if(NOT TARGET ${__target})
message(AUTHOR_WARNING "${__target} is not a valid CMake target!")
continue()
endif()
set_property(TARGET ${__target} APPEND PROPERTY AUTOMOC_MACRO_NAMES "FRAMELESSHELPER_QT_CLASS;FRAMELESSHELPER_PUBLIC_QT_CLASS;FRAMELESSHELPER_PRIVATE_QT_CLASS")
endforeach()
endfunction()
if(FRAMELESSHELPER_BUILD_WIDGETS OR FRAMELESSHELPER_BUILD_QUICK)
add_subdirectory(src)
endif()

View File

@ -35,7 +35,7 @@ FramelessApplicationWindow {
height: 600
title: qsTr("FramelessHelper demo application - Qt Quick [") + objectName + ']'
color: {
if (FramelessHelper.blurBehindWindowEnabled && FramelessUtils.blurBehindWindowSupported) {
if (FramelessHelper.blurBehindWindowEnabled) {
return "transparent";
}
if (FramelessUtils.systemTheme === FramelessHelperConstants.Dark) {

View File

@ -35,7 +35,7 @@ FramelessWindow {
height: 600
title: qsTr("FramelessHelper demo application - Qt Quick [") + objectName +']'
color: {
if (FramelessHelper.blurBehindWindowEnabled && FramelessUtils.blurBehindWindowSupported) {
if (FramelessHelper.blurBehindWindowEnabled) {
return "transparent";
}
if (FramelessUtils.systemTheme === FramelessHelperConstants.Dark) {

View File

@ -34,7 +34,6 @@
#include <QtWidgets/qboxlayout.h>
#include <QtWidgets/qfileiconprovider.h>
#include <FramelessHelper/Core/framelessmanager.h>
#include <FramelessHelper/Core/utils.h>
#include <FramelessHelper/Widgets/framelesswidgetshelper.h>
#include <FramelessHelper/Widgets/standardtitlebar.h>
#include <FramelessHelper/Widgets/standardsystembutton.h>
@ -188,7 +187,7 @@ void Widget::updateStyleSheet()
m_clockLabel->setStyleSheet(labelStyleSheet);
m_compilerInfoLabel->setStyleSheet(labelStyleSheet);
m_commitInfoLabel->setStyleSheet(labelStyleSheet);
if (FramelessWidgetsHelper::get(this)->isBlurBehindWindowEnabled() && Utils::isBlurBehindWindowSupported()) {
if (FramelessWidgetsHelper::get(this)->isBlurBehindWindowEnabled()) {
setStyleSheet(FRAMELESSHELPER_STRING_LITERAL("background-color: transparent;"));
} else {
const QColor windowBackgroundColor = (dark ? kDefaultSystemDarkColor : kDefaultSystemLightColor);

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class ChromePalettePrivate;
class FRAMELESSHELPER_CORE_API ChromePalette : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(ChromePalette)
Q_PROPERTY(QColor titleBarActiveBackgroundColor READ titleBarActiveBackgroundColor

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessHelperQtPrivate;
class FRAMELESSHELPER_CORE_API FramelessHelperQt : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessHelperQt)
public:

View File

@ -316,7 +316,6 @@ QT_END_NAMESPACE
#ifndef FRAMELESSHELPER_QT_CLASS
# define FRAMELESSHELPER_QT_CLASS(Class) \
private: \
Q_OBJECT \
FRAMELESSHELPER_CLASS_INFO \
FRAMELESSHELPER_CLASS(Class)
#endif

View File

@ -32,6 +32,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessManagerPrivate;
class FRAMELESSHELPER_CORE_API FramelessManager : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessManager)
Q_PROPERTY(Global::SystemTheme systemTheme READ systemTheme WRITE setOverrideTheme NOTIFY systemThemeChanged FINAL)
Q_PROPERTY(QColor systemAccentColor READ systemAccentColor NOTIFY systemThemeChanged FINAL)

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class MicaMaterialPrivate;
class FRAMELESSHELPER_CORE_API MicaMaterial : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(MicaMaterial)
Q_PROPERTY(QColor tintColor READ tintColor WRITE setTintColor NOTIFY tintColorChanged FINAL)

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class ChromePalette;
class FRAMELESSHELPER_CORE_API ChromePalettePrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(ChromePalette)
public:

View File

@ -30,6 +30,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_CORE_API FramelessConfig : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(FramelessConfig)
public:

View File

@ -36,6 +36,7 @@ using FramelessDataPtr = std::shared_ptr<FramelessData>;
class FramelessManager;
class FRAMELESSHELPER_CORE_API FramelessManagerPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessManager)
public:

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class MicaMaterial;
class FRAMELESSHELPER_CORE_API MicaMaterialPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(MicaMaterial)
public:

View File

@ -60,6 +60,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_CORE_API RegistryKey : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(RegistryKey)
public:

View File

@ -30,6 +30,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_CORE_API SysApiLoader : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(SysApiLoader)
public:

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class WindowBorderPainter;
class FRAMELESSHELPER_CORE_API WindowBorderPainterPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(WindowBorderPainter)
public:

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class WindowBorderPainterPrivate;
class FRAMELESSHELPER_CORE_API WindowBorderPainter : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(WindowBorderPainter)
Q_PROPERTY(int thickness READ thickness WRITE setThickness NOTIFY thicknessChanged FINAL)

View File

@ -87,6 +87,7 @@ FRAMELESSHELPER_QUICK_API void FramelessHelperQuickRegisterTypes(QQmlEngine *);
class FRAMELESSHELPER_QUICK_API QuickGlobal : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(QuickGlobal)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(FramelessHelperConstants)

View File

@ -41,6 +41,7 @@ class QuickWindowBorder;
class FramelessQuickHelperPrivate;
class FRAMELESSHELPER_QUICK_API FramelessQuickHelper : public QQuickItem
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessQuickHelper)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(FramelessHelper)

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_QUICK_API FramelessQuickUtils : public QObject, public QQmlParserStatus
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(FramelessQuickUtils)
Q_INTERFACES(QQmlParserStatus)
#ifdef QML_NAMED_ELEMENT

View File

@ -36,6 +36,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessQuickApplicationWindowPrivate;
class FRAMELESSHELPER_QUICK_API FramelessQuickApplicationWindow : public QQuickApplicationWindow
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessQuickApplicationWindow)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(FramelessApplicationWindow)

View File

@ -39,6 +39,7 @@ class QuickWindowBorder;
class FramelessQuickApplicationWindow;
class FRAMELESSHELPER_QUICK_API FramelessQuickApplicationWindowPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessQuickApplicationWindow)
public:

View File

@ -44,6 +44,7 @@ class QuickWindowBorder;
class FramelessQuickHelper;
class FRAMELESSHELPER_QUICK_API FramelessQuickHelperPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessQuickHelper)
public:

View File

@ -36,6 +36,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessQuickWindowPrivate;
class FRAMELESSHELPER_QUICK_API FramelessQuickWindow : public QQuickWindowQmlImpl
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessQuickWindow)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(FramelessWindow)

View File

@ -39,6 +39,7 @@ class QuickWindowBorder;
class FramelessQuickWindow;
class FRAMELESSHELPER_QUICK_API FramelessQuickWindowPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessQuickWindow)
public:

View File

@ -32,6 +32,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_QUICK_API QuickImageItem : public QQuickPaintedItem
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(QuickImageItem)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(ImageItem)

View File

@ -35,6 +35,7 @@ class MicaMaterial;
class QuickMicaMaterial;
class FRAMELESSHELPER_QUICK_API QuickMicaMaterialPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(QuickMicaMaterial)
public:

View File

@ -39,6 +39,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_QUICK_API QuickStandardSystemButton : public QQuickButton
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(QuickStandardSystemButton)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(StandardSystemButton)

View File

@ -45,6 +45,7 @@ class QuickImageItem;
class FRAMELESSHELPER_QUICK_API QuickStandardTitleBar : public QQuickRectangle
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(QuickStandardTitleBar)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(StandardTitleBar)

View File

@ -35,6 +35,7 @@ class WindowBorderPainter;
class QuickWindowBorder;
class FRAMELESSHELPER_QUICK_API QuickWindowBorderPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(QuickWindowBorder)
public:

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FRAMELESSHELPER_QUICK_API QuickChromePalette : public ChromePalette, public QQmlParserStatus
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(QuickChromePalette)
Q_INTERFACES(QQmlParserStatus)
#ifdef QML_ANONYMOUS

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class QuickMicaMaterialPrivate;
class FRAMELESSHELPER_QUICK_API QuickMicaMaterial : public QQuickPaintedItem
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(QuickMicaMaterial)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(MicaMaterial)

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class QuickWindowBorderPrivate;
class FRAMELESSHELPER_QUICK_API QuickWindowBorder : public QQuickPaintedItem
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(QuickWindowBorder)
#ifdef QML_NAMED_ELEMENT
QML_NAMED_ELEMENT(WindowBorder)

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessDialogPrivate;
class FRAMELESSHELPER_WIDGETS_API FramelessDialog : public QDialog
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessDialog)
public:

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessMainWindowPrivate;
class FRAMELESSHELPER_WIDGETS_API FramelessMainWindow : public QMainWindow
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessMainWindow)
Q_PROPERTY(bool hidden READ isHidden NOTIFY hiddenChanged FINAL)
Q_PROPERTY(bool normal READ isNormal NOTIFY normalChanged FINAL)

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class FramelessWidgetPrivate;
class FRAMELESSHELPER_WIDGETS_API FramelessWidget : public QWidget
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessWidget)
Q_PROPERTY(bool hidden READ isHidden NOTIFY hiddenChanged FINAL)
Q_PROPERTY(bool normal READ isNormal NOTIFY normalChanged FINAL)

View File

@ -40,6 +40,7 @@ class WindowBorderPainter;
class FramelessWidgetsHelperPrivate;
class FRAMELESSHELPER_WIDGETS_API FramelessWidgetsHelper : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessWidgetsHelper)
Q_PROPERTY(QWidget* titleBarWidget READ titleBarWidget WRITE setTitleBarWidget NOTIFY titleBarWidgetChanged FINAL)
Q_PROPERTY(bool windowFixedSize READ isWindowFixedSize WRITE setWindowFixedSize NOTIFY windowFixedSizeChanged FINAL)

View File

@ -35,6 +35,7 @@ class WidgetsSharedHelper;
class FramelessDialog;
class FRAMELESSHELPER_WIDGETS_API FramelessDialogPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessDialog)
public:

View File

@ -35,6 +35,7 @@ class WidgetsSharedHelper;
class FramelessMainWindow;
class FRAMELESSHELPER_WIDGETS_API FramelessMainWindowPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessMainWindow)
public:

View File

@ -35,6 +35,7 @@ class WidgetsSharedHelper;
class FramelessWidget;
class FRAMELESSHELPER_WIDGETS_API FramelessWidgetPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessWidget)
public:

View File

@ -42,6 +42,7 @@ class WidgetsSharedHelper;
class FramelessWidgetsHelper;
class FRAMELESSHELPER_WIDGETS_API FramelessWidgetsHelperPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessWidgetsHelper)
public:

View File

@ -34,6 +34,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class StandardSystemButton;
class FRAMELESSHELPER_WIDGETS_API StandardSystemButtonPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(StandardSystemButton)
public:

View File

@ -44,6 +44,7 @@ class ChromePalette;
class StandardTitleBar;
class FRAMELESSHELPER_WIDGETS_API StandardTitleBarPrivate : public QObject
{
Q_OBJECT
FRAMELESSHELPER_PRIVATE_QT_CLASS(StandardTitleBar)
public:

View File

@ -38,6 +38,7 @@ class WindowBorderPainter;
class FRAMELESSHELPER_WIDGETS_API WidgetsSharedHelper : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(WidgetsSharedHelper)
#if FRAMELESSHELPER_CONFIG(mica_material)
Q_PROPERTY(bool micaEnabled READ isMicaEnabled WRITE setMicaEnabled NOTIFY micaEnabledChanged FINAL)

View File

@ -35,6 +35,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class StandardSystemButtonPrivate;
class FRAMELESSHELPER_WIDGETS_API StandardSystemButton : public QPushButton
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(StandardSystemButton)
Q_PROPERTY(Global::SystemButtonType buttonType READ buttonType WRITE setButtonType NOTIFY buttonTypeChanged FINAL)
Q_PROPERTY(QString glyph READ glyph WRITE setGlyph NOTIFY glyphChanged FINAL)

View File

@ -40,6 +40,7 @@ FRAMELESSHELPER_BEGIN_NAMESPACE
class StandardTitleBarPrivate;
class FRAMELESSHELPER_WIDGETS_API StandardTitleBar : public QWidget
{
Q_OBJECT
FRAMELESSHELPER_PUBLIC_QT_CLASS(StandardTitleBar)
Q_PROPERTY(Qt::Alignment titleLabelAlignment READ titleLabelAlignment WRITE setTitleLabelAlignment NOTIFY titleLabelAlignmentChanged FINAL)
#if (!defined(Q_OS_MACOS) && FRAMELESSHELPER_CONFIG(system_button))

View File

@ -281,7 +281,6 @@ if(NOT FRAMELESSHELPER_BUILD_STATIC)
endif()
setup_qt_stuff(TARGETS ${SUB_MODULE_TARGET})
setup_custom_moc_macros(TARGETS ${SUB_MODULE_TARGET})
set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)

View File

@ -843,53 +843,23 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
const auto clientHeight = RECT_HEIGHT(clientRect);
const QPoint qtScenePos = Utils::fromNativeLocalPosition(qWindow, QPoint(nativeLocalPos.x, nativeLocalPos.y));
const bool isFixedSize = data->callbacks->isWindowFixedSize();
const bool isTitleBar = data->callbacks->isInsideTitleBarDraggableArea(qtScenePos);
const bool dontOverrideCursor = data->callbacks->getProperty(kDontOverrideCursorVar, false).toBool();
const bool dontToggleMaximize = data->callbacks->getProperty(kDontToggleMaximizeVar, false).toBool();
if (dontToggleMaximize) {
static bool warnedOnce = false;
if (!warnedOnce) {
warnedOnce = true;
DEBUG << "To disable window maximization, you should remove the "
"WS_MAXIMIZEBOX style from the window instead. FramelessHelper "
"won't do that for you, so you'll have to do it manually yourself.";
}
}
SystemButtonType sysButtonType = SystemButtonType::Unknown;
if (!isFixedSize && data->callbacks->isInsideSystemButtons(qtScenePos, &sysButtonType)) {
// Firstly, we set the hit test result to a default value to be able to detect whether we
// have changed it or not afterwards.
*result = HTNOWHERE;
if (data->callbacks->isInsideSystemButtons(qtScenePos, &sysButtonType)) {
// Even if the mouse is inside the chrome button area now, we should still allow the user
// to be able to resize the window with the top or right window border, this is also the
// normal behavior of a native Win32 window (but only when the window is not maximized/
// fullscreened/minimized, of course).
if (Utils::isWindowNoState(windowId)) {
static constexpr const int kBorderSize = 2;
const bool isTop = (nativeLocalPos.y <= kBorderSize);
const bool isRight = (nativeLocalPos.x >= (clientWidth - kBorderSize));
if (isTop || isRight) {
if (dontOverrideCursor) {
// The user doesn't want the window to be resized, so we tell Windows we are
// in the client area so that the controls beneath the mouse cursor can still
// be hovered or clicked.
*result = (isTitleBar ? HTCAPTION : HTCLIENT);
} else {
if (isTop && isRight) {
*result = HTTOPRIGHT;
} else if (isTop) {
*result = HTTOP;
} else {
*result = HTRIGHT;
}
}
// normal behavior of a native Win32 window.
static constexpr const int kBorderSize = 2;
const bool isTop = (nativeLocalPos.y <= kBorderSize);
const bool isRight = (nativeLocalPos.x >= (clientWidth - kBorderSize));
if (isTop || isRight) {
if (isTop && isRight) {
*result = HTTOPRIGHT;
} else if (isTop) {
*result = HTTOP;
} else {
*result = HTRIGHT;
}
}
if (*result == HTNOWHERE) {
} else {
// OK, we are now really inside one of the chrome buttons, tell Windows the exact role of our button.
// The Snap Layout feature introduced in Windows 11 won't work without this.
switch (sysButtonType) {
@ -910,14 +880,10 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
*result = HTCLOSE;
break;
case SystemButtonType::Unknown:
*result = HTCLIENT; // Normally we'd never enter this branch.
break;
}
}
if (*result == HTNOWHERE) {
// OK, it seems we are not inside the window resize area, nor inside the chrome buttons,
// tell Windows we are in the client area to let Qt handle this event.
*result = HTCLIENT;
}
return true;
}
// OK, we are not inside of any chrome buttons, try to find out which part of the window
@ -927,16 +893,26 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
const bool full = Utils::isFullScreen(windowId);
const int frameSizeY = Utils::getResizeBorderThickness(windowId, false, true);
const bool isTop = (nativeLocalPos.y < frameSizeY);
const bool isTitleBar = data->callbacks->isInsideTitleBarDraggableArea(qtScenePos);
const bool isFixedSize = data->callbacks->isWindowFixedSize();
const bool dontOverrideCursor = data->callbacks->getProperty(kDontOverrideCursorVar, false).toBool();
const bool dontToggleMaximize = data->callbacks->getProperty(kDontToggleMaximizeVar, false).toBool();
if (dontToggleMaximize) {
static bool once = false;
if (!once) {
once = true;
DEBUG << "To disable window maximization, you should remove the "
"WS_MAXIMIZEBOX style from the window instead. FramelessHelper "
"won't do that for you, so you'll have to do it manually yourself.";
}
}
if (frameBorderVisible) {
// This will handle the left, right and bottom parts of the frame
// because we didn't change them.
const LRESULT originalHitTestResult = ::DefWindowProcW(hWnd, WM_NCHITTEST, 0, lParam);
if (originalHitTestResult != HTCLIENT) {
// Even if the window is not resizable, we still can't return HTCLIENT here because
// when we enters this code path, it means the mouse cursor is outside of the window,
// that is, the three transparent window resize area. Returning HTCLIENT will confuse
// Windows and we can't put our controls there anyway.
*result = ((isFixedSize || dontOverrideCursor) ? HTBORDER : originalHitTestResult);
return true;
}
@ -957,7 +933,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
// Return HTCLIENT instead of HTBORDER here, because the mouse is
// inside our homemade title bar now, return HTCLIENT to let our
// title bar can still capture mouse events.
*result = ((isFixedSize || dontOverrideCursor) ? (isTitleBar ? HTCAPTION : HTCLIENT) : HTTOP);
*result = ((isFixedSize || dontOverrideCursor) ? HTCLIENT : HTTOP);
return true;
}
if (isTitleBar) {
@ -986,7 +962,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
// Return HTCLIENT instead of HTBORDER here, because the mouse is
// inside the window now, return HTCLIENT to let the controls
// inside our window can still capture mouse events.
*result = (isTitleBar ? HTCAPTION : HTCLIENT);
*result = HTCLIENT;
return true;
}
if (isTop) {

View File

@ -45,6 +45,7 @@
#include <QtCore/qloggingcategory.h>
#include <QtGui/qfontdatabase.h>
#include <QtGui/qwindow.h>
#include <QtGui/qevent.h>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0))
# include <QtGui/qguiapplication.h>
# include <QtGui/qstylehints.h>
@ -107,6 +108,7 @@ Q_GLOBAL_STATIC(InternalData, g_internalData)
class InternalEventFilter : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(InternalEventFilter)
public:

View File

@ -492,6 +492,7 @@ static inline void expblur(QImage &img, qreal radius, const bool improvedQuality
class WallpaperThread : public FramelessHelperThreadClass
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(WallpaperThread)
public:

View File

@ -222,6 +222,7 @@ private:
class NSWindowProxy : public QObject
{
Q_OBJECT
FRAMELESSHELPER_QT_CLASS(NSWindowProxy)
public:

View File

@ -261,7 +261,6 @@ if(NOT FRAMELESSHELPER_BUILD_STATIC)
endif()
setup_qt_stuff(TARGETS ${SUB_MODULE_TARGET} ALLOW_KEYWORD)
setup_custom_moc_macros(TARGETS ${SUB_MODULE_TARGET})
set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)

View File

@ -594,10 +594,7 @@ bool FramelessQuickHelperPrivate::shouldIgnoreMouseEvents(const QPoint &pos) con
if (!window) {
return false;
}
const auto withinFrameBorder = [q, &pos, window]() -> bool {
if (q->isWindowFixedSize()) {
return false;
}
const auto withinFrameBorder = [&pos, window]() -> bool {
if (pos.y() < kDefaultResizeBorderThickness) {
return true;
}

View File

@ -153,7 +153,6 @@ if(NOT FRAMELESSHELPER_BUILD_STATIC)
endif()
setup_qt_stuff(TARGETS ${SUB_MODULE_TARGET})
setup_custom_moc_macros(TARGETS ${SUB_MODULE_TARGET})
set(__extra_flags "")
if(NOT FRAMELESSHELPER_NO_PERMISSIVE_CHECKS)

View File

@ -655,9 +655,6 @@ bool FramelessWidgetsHelperPrivate::shouldIgnoreMouseEvents(const QPoint &pos) c
return false;
}
const auto withinFrameBorder = [this, &pos]() -> bool {
if (isWidgetFixedSize(window)) {
return false;
}
if (pos.y() < kDefaultResizeBorderThickness) {
return true;
}