CustomFrame: Use an enum instead of bool return in our callback

This commit is contained in:
Sergio Martins
2021-02-18 14:22:26 +00:00
parent cd19c5eb38
commit 52ce80fd97
2 changed files with 18 additions and 3 deletions

View File

@@ -602,9 +602,15 @@ bool CustomFrameHelper::nativeEventFilter(const QByteArray &eventType, void *mes
auto msg = static_cast<MSG *>(message);
QWindow *window = QWindow::fromWinId(WId(msg->hwnd));
if (!window || !m_shouldUseCustomFrameFunc(window))
if (!window)
return false;
const Features features = m_shouldUseCustomFrameFunc(window);
if (features == Feature_None) {
// No native support for is desired for this window
return false;
}
const char *propertyName = "kddw_customframe_setup_ran";
const bool setupRan = window->property(propertyName).toBool();
if (!setupRan) {