MDI: Fix case where resize cursor would be shown for frame bellow
Was already fixed a few days ago, but this is the case for nested mdi.
This commit is contained in:
@@ -388,6 +388,33 @@ inline T* firstParentOfType(const QObject *child)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T* lastParentOfType(const QObject *child)
|
||||
{
|
||||
auto p = const_cast<QObject *>(child);
|
||||
T* result = nullptr;
|
||||
while (p) {
|
||||
if (auto candidate = qobject_cast<T *>(p))
|
||||
result = candidate;
|
||||
|
||||
if (qobject_cast<const QWindow*>(p)) {
|
||||
// Ignore QObject hierarchies spanning though multiple windows
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||
// Ignore QObject hierarchies spanning though multiple windows
|
||||
if (auto w = qobject_cast<QWidget *>(p))
|
||||
if (w->isWindow())
|
||||
return result;
|
||||
#endif
|
||||
|
||||
p = p->parent();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -101,6 +101,11 @@ bool WidgetResizeHandler::eventFilter(QObject *o, QEvent *e)
|
||||
// We only want to continue if the cursor is near the margins of our own frame (mTarget)
|
||||
|
||||
auto frame = firstParentOfType<Frame>(widget);
|
||||
if (frame && frame->isMDIWrapper()) {
|
||||
// We don't care about the inner Option_MDINestable helper frame
|
||||
frame = frame->mdiFrame();
|
||||
}
|
||||
|
||||
if (frame && frame != mTarget) {
|
||||
const bool areSiblings = frame->QWidgetAdapter::parentWidget() == mTarget->parentWidget();
|
||||
if (areSiblings)
|
||||
|
||||
Reference in New Issue
Block a user