parent
2dbdca2999
commit
f68665298b
|
@ -27,8 +27,8 @@
|
|||
</compatibility>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM, True</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
|
|
|
@ -70,6 +70,9 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
|||
return false;
|
||||
}
|
||||
const auto window = qobject_cast<QWindow *>(object);
|
||||
if (Utilities::isWindowFixedSize(window)) {
|
||||
return false;
|
||||
}
|
||||
const auto mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
const QPointF localPos = mouseEvent->position();
|
||||
|
|
|
@ -584,6 +584,10 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
|
|||
// another branch, if you are interested in it, you can give it a
|
||||
// try.
|
||||
|
||||
if (Utilities::isWindowFixedSize(window)) {
|
||||
*result = HTCLIENT;
|
||||
return true;
|
||||
}
|
||||
const POINT globalPos = {GET_X_LPARAM(msg->lParam), GET_Y_LPARAM(msg->lParam)};
|
||||
POINT localPos = globalPos;
|
||||
if (ScreenToClient(msg->hwnd, &localPos) == FALSE) {
|
||||
|
|
|
@ -79,4 +79,18 @@ Qt::Edges Utilities::calculateWindowEdges(const QWindow *window, const QPointF &
|
|||
return edges;
|
||||
}
|
||||
|
||||
bool Utilities::isWindowFixedSize(const QWindow *window)
|
||||
{
|
||||
Q_ASSERT(window);
|
||||
if (!window) {
|
||||
return false;
|
||||
}
|
||||
if (window->flags() & Qt::MSWindowsFixedSizeDialogHint) {
|
||||
return true;
|
||||
}
|
||||
const QSize minSize = window->minimumSize();
|
||||
const QSize maxSize = window->maximumSize();
|
||||
return (!minSize.isEmpty() && !maxSize.isEmpty() && (minSize == maxSize));
|
||||
}
|
||||
|
||||
FRAMELESSHELPER_END_NAMESPACE
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace Utilities
|
|||
[[nodiscard]] FRAMELESSHELPER_API Qt::Edges calculateWindowEdges(const QWindow *window, const QPointF &pos);
|
||||
FRAMELESSHELPER_API void startSystemMove(QWindow *window);
|
||||
FRAMELESSHELPER_API void startSystemResize(QWindow *window, const Qt::Edges edges);
|
||||
[[nodiscard]] FRAMELESSHELPER_API bool isWindowFixedSize(const QWindow *window);
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
[[nodiscard]] FRAMELESSHELPER_API bool isWin8OrGreater();
|
||||
|
|
Loading…
Reference in New Issue