Client: Ensure that guessed popup parent has a shell surface

The last input window may not have a shell surface if it is a subsurface
or that window has been just made invisible.

Pick-to: 6.8 6.7
Change-Id: Iad11c68659579429ddc5d9ba0038975b25da8e0d
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Vlad Zahorodnii 2024-06-20 11:25:06 +03:00
parent ec951588a8
commit df83f3e568

View File

@ -1189,8 +1189,10 @@ QWaylandWindow *QWaylandWindow::guessTransientParent() const
return mTopPopup;
}
if (window()->type() == Qt::ToolTip || window()->type() == Qt::Popup)
return display()->lastInputWindow();
if (window()->type() == Qt::ToolTip || window()->type() == Qt::Popup) {
if (auto lastInputWindow = display()->lastInputWindow())
return closestShellSurfaceWindow(lastInputWindow->window());
}
return nullptr;
}